Monday, December 8, 2008

Video Startup

Been working on the video startup code today; previously I was just running in a 1024 x 768 window. It's all coming together well; a little bit more involved than I had originally hoped, as Direct3D requires a lot of format enumeration before you can run a fullscreen mode (outside of demo programs, anyway). Here's where an equivalent of ChoosePixelFormat would be a Good Thing; just being able to specify what you'd like and having the API go off and find a good match is something of a luxury.

There's so much else that's different though that it's almost a full rewrite of the old gl_vidnt code; which is - to be honest - something that was much needed. And on balance, Direct 3D wins out by a clear mile, as once you get over the enumeration you're pretty much good to go; none of this lark of checking extensions, doing GetProcAddress on function pointers, and always being concerned that ATI or Intel will blow up somewhere.

The fact that the Direct 3D device will even switch resolution for you without having to do ChangeDisplaySettings is rather nice too.

I also reworked texture loading a little; I'm not wrapping the data in a TGA anymore, and I'm resampling at the same time as upsampling. It's considerably more memory efficient as Direct 3D lets you get direct access to the texels. Currently I have a simple nearest-neighbour resample, which I guess is roughly equivalent to ID's GL_ResampleTexture.

Been thinking about the status of my OpenGL code base; I'm starting to feel that I might release it "as is", as unfinished code, and focus on the Direct 3D port moving forwards. I'm in a position where I have a lot of code to port over whichever becomes my new codebase, and while I could just stick with the OpenGL codebase, I've about had my fill of OpenGL right now; it's not really the API's fault, but rather the vendors and regulators who are killing it.

Needless to say, the Direct 3D engine will be released sooner rather than later, as a feature-free basic port, before I start moving forward with anything (whatever I do decide to move forward with). I'll make a decision on the main codebase roundabout that time too.

0 comments: