Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Windows OpenGL 3 Hello World Demo Released

  1. #1
    Intern Newbie
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    49

    Windows OpenGL 3 Hello World Demo Released

    After a long stint on XNA and Direct3D I've recently come back to OpenGL. Whilst reading the specs and docs to come up to speed on the latest version of OpenGL I ended up writing a basic OpenGL 3.1 (forward compatible 3.0) app to help with my learning. Anyway I'm releasing the code in the hopes that other developers in a similar situation might find it useful.

    http://www.dhpoware.com/demos/gl3HelloWorld.html

  2. #2
    Intern Contributor
    Join Date
    May 2006
    Posts
    55

    Re: Windows OpenGL 3 Hello World Demo Released

    That's great, thanks very much for your contribution, I'm sure it will help quite a few people get started with the forward compatible OpenGL 3.x series.

    However I want to make some comments regarding it.

    Having read Mark Kilgard's recent comments on deprecation, I have to agree somewhat with him that at this stage deprecation could possibly increase your hacking time a little...

    I did an sloccount on your code to determine the total amount of effort required to initialise a context, set up a quad and texture it with a png.

    Total Physical Source Lines of Code (SLOC) = 5,607
    Schedule Estimate, Years (Months) = 0.58 (6.94(Months!))
    Est'd Avg # of devs (Effort/Schedule) = 2.11
    Total Estimated Cost to Develop = $ 165,123

    Yeah yeah, it's good fun to play with sloccount.. but still, 5607 lines of code.

    To put this in perspective, I wrote an OpenGL API 1.1 wrapper header that does complete 2D ortho texture and quad management with png decoding built-in to the header itself and when I sloccounted it, it came to 2,376 lines of code for the whole thing. -Less than half the size of this example.

    I'm guessing the 3 series is at an early stage where wrangling utilities/headers haven't been developed yet. Because the boiler-plate 3.x code seems to be fairly verbose.

    And finally from the code:

    // OpenGL 3.0 also deprecates fixed-function vertex processing. This means

    // that we also need to calculate the projection, view, and model matrices

    // by ourself.

    Oh.. /Reads book on calculating projection, view and model matrices. (sigh) :-)

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2006
    Location
    Edinburgh - Scotland
    Posts
    146

    Re: Windows OpenGL 3 Hello World Demo Released

    Nice example. I really like the stuff on your site.

    but still, 5607 lines of code.
    Did you look at the code? There's almost 3000 lines of (probably auto-gen'ed) code for getting function pointers. Plus code for mouse etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •