• Advertisement
Sign in to follow this  
  • entries
    3
  • comments
    8
  • views
    1376

Well duh!

Sign in to follow this  

248 views

I spent some time this weekend working on my little app project at home, which has progressed well - I'm now at the 7th milestone out of the 9 I set myself.

Currently the application is still quite small but is starting to develop the features I wanted from it - basically having written in the OpenGL shader support and then built a material system on top of it, including reusing a file parser utility my Doom 3 model viewer (which I really should finish!!).

Over the weekend though I managed to hit one those moments which had me seriously considering if everything I wrote was correct. Having started the project and just displayed a flat 2D poly to test the shader & material support it was time to move to displaying proper 3D objects ... setup the projection matrix, move the camera ... err ... where is the polygon?!

Queue a few hours of scratching head, putting in a moving camera and generally lots of code reading, only to discover the mistake by accident ...

See - when the app starts up you get a WM_SIZE message, which I handled to setup the viewport & projection matrix for the application ... what I hadn't done was to ensure that the OpenGL context had actually been created before hand. I only noticed this after accidentally resizing the application and suddenly everything appearing correctly on screen. Queue much head bashing on desk, 30 seconds of coding and recompilation ... and suddenly it worked.

Ever just had one of those moments?

Edit:

Also - as a side note, be careful when trying to use Vertex Buffer Objects or Vertex Arrays with OpenGL. I had a problem today not long after posting this where I couldn't figure out why the app was crashing. Turns out that you need to be careful when specifying what arrays are active - and I'd left one enabled when I shouldn't have ... see - I still have bits and pieces to learn!
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement