''The Trip,'' a first feature written and directed by Miles Swain, is a gay melodrama with a historical dimension. The title, meant to be taken on a few metaphorical levels, refers first and foremost to the personal journey of Alan Oakley (Larry Sullivan), who begins the film in 1973 as a straight, uptight Young Republican working for an establishment newspaper and who eventually finds happiness as an openly gay man working for a radical homosexual-rights organization called Out Loud.

The agent of Alan's transformation is Tommy Ballenger (Steve Braun), a Texas teenager who has moved to Los Angeles to work for gay rights. When Alan first meets him -- at a louche party organized by Peter Baxter (Ray Baker), an older entertainment lawyer -- Alan sees Tommy as a potential interview subject for his book, a conservative attack on gay rights that he plans to call ''The Straight Truth.''

Before you can say ''closet case,'' Alan and Tommy are in bed together, an occasion marked by much forced hilarity when Alan's parents, a retired Army officer (Art Hindle) and a former Las Vegas showgirl (Jill St. John, in a remarkably poised appearance), show up for a visit the morning after.

Alan and Tommy soon make a gratingly perfect couple, which rouses the envy of scaly old Peter. His cunning plan, worthy of Alexis Carrington at her worst, consists of forcing a friend to publish Alan's long-abandoned, long-repudiated manuscript anonymously. When the book immediately becomes a best seller -- it is now 1977, at the height of Anita Bryant's ''Save Our Children'' campaign -- Alan continues to hide his authorship (though surely one talk show appearance denouncing his own former self would have gained his movement considerable publicity), allowing Peter to inform the media.

Imagine the look of surprise on Tommy's face when one of those annoying ''Live at Five'' reporters points a microphone at him and demands, ''Are you aware that the author of 'The Straight Truth' is your roommate of the last four years?''

But wait, as they say in infomercials, there's more: you also get a set of Ginsu steak knives, in the form of a third act, set in 1984, that finds Alan living in resigned misery with the predatory Peter. He receives a message from an old friend telling him that Tommy, now living in Mexico, is dying of AIDS and would like to see his former lover one more time.

So here begins the literal trip in ''The Trip,'' as the reunited companions try to cross rural Mexico in a beat-up convertible, hoping to take Tommy back to Texas for some treatment. The trip involves committing a couple of major felonies, considered here -- as in so many Hollywood films -- as essential steps on the way to self-actualization (viz. ''Thelma and Louise'').

With its implausible coincidences, inelegant plot twists and minimally characterized characters, ''The Trip,'' which opens today nationwide, doesn't have much going for it apart from its basic sincerity and decency, which are evident. Mr. Swain himself might benefit from some of the loosening up he has prescribed for Alan; his subject may be gay, but his film never departs from the straight-and-narrow technique of a television movie. DAVE KEHR