Which type of line did you cross, and how many lines were there?
Look here:
The Texas Highway Man Pages - Texas Traffic Laws (and good driving habits)
If it was a single white line you will see that crossing a line is "discouraged" for safety reasons, but NOT illegal. The officer will have to explain how your movement was a safety hazard, not simply that you crossed the line. You can make this argument and likely prevail if there was no additional safety issue (but be prepared with the Texas code that gives this definition).
HOWEVER, if you crossed TWO lines, you likely were in violation. This is an illegal lane change, not a crossing of the median.
As for the median- the officer has the wrong definition of terms. The median is the space between opposing lanes of traffic. You should easily beat that part of it just based on definition, however the court could simply amend it and apply the correct violation.
So... what exactly did you cross?