OpenGl Modern 3d Graphics Programming - glsdk/tut 01 run error

Hi there I hope someone can help me with this. I’ve been trying to get the Tutorials from “Modern 3D Graphics Programming” to run and they basically throw an error when I try to run the build, its worth mentioning the build itself compiled successfully. Heres the steps I took:

  1. Downloaded ‘Tutorial 0.3.8’ and premake
  2. Extracted files and ran premake4.lua for glsdk using “premake vs2010”
  3. Built the .sln using VS2010 (not Express, fresh install), build successful
  4. Tried to run the debug build and got error “Unable to start program ‘C:…\Tutorial 0.3.8\glsdk\glload\lib\glloadD.lib’.”
  5. Ran premake4.lua for /Tut 01/ and built the .sln successfully
  6. Tried to run the debug build and got error "Unable to start program ‘C:…\Tutorial 0.3.8\framework\lib\frameworkD.lib’.
    The specified file is an unrecognized or unsupported binary format.

So, the builds are building just fine its just the run I’m having trouble with, no build errors whatsoever. Really is quite frustrating to me, as I would love to get started on reading the book. I’m using a 8400M running on a newer HP Pavillion, so I’m set for openGL 3.3 compatibility. I’m not sure at all what the problem could be, I’m used to mucking about with the VC++ Directories to add includes and libs but this seemed almost too easy to setup initally. Plech! It was too good to be true I guess, any help with getting the project to run would be greatly appreciated, thanks.

Tried to run the debug build and got error “Unable to start program ‘C:.…\Tutorial 0.3.8\glsdk\glload\lib\glloadD.lib’.”

The debug build of what? The SDK isn’t a program; it’s a library. There’s nothing to run. That’s why the instructions don’t say “run the SDK”; you just build it.

Tried to run the debug build and got error "Unable to start program ‘C:.…\Tutorial 0.3.8\framework\lib\frameworkD.lib’.

That’s because you’re trying to run the framework project. Notice that there are two projects in the solution; the actual tutorial and the framework library. You should right-click on the tutorial and set it to be the “Startup Project”.

Perfect! You’ve just solved all my problems, forever. :smiley:

Thanks again, Alfonse. I look forward to following your tutorial.

I had a question regarding one of the ‘Further Study’ appends at the end of the first chapter, when you say:

Change the reshape function so that it respects aspect ratio. This means that the area rendered to may be smaller than the window area. Also,
try to make it so that it always centers the area within the window

I’m trying to understand what you mean here. Its probably a simple thing I’m not understanding, but I think you mean that when you increase ‘w’ or ‘h’ for the reshape function (which transforms the drawn area but not the window) I should be trying to retool what comes in to reshape to fit a certain aspect ratio (4:3 or 16:9), and also find a way to center the drawn area to the window. Is this correct?

Sorry for asking all these dumb questions, it seems like a trivial question. Maybe I need a C++ refresher if I’m having these questions in the first chapter, who knows?:confused:

but I think you mean that when you increase ‘w’ or ‘h’ for the reshape function (which transforms the drawn area but not the window)

It’s the other way round: GLUT calls the reshape function you specified when you manually or programmatically change the size. You have to react to that change by altering the viewport you’re rendering to, to make sure the viewport is still covers the same relative area of the window as it did before. Also, if the aspect ratio changed, i.e. the quotient width / height has changed, you need to update your projection accordingly. If you want some concrete aspect ratio you can use glutReshapeWindow() to change the window size to something that matches that ratio. Still, you should have the functions for viewport and projection updates in the reshape function.