Jump to content
Tuts 4 You

Now you can follow NeHe's tutorials in Masm! (gl.def, glu.def, include.def here)


ViL

Recommended Posts

While looking at Nehe's tutorial for opengl i noticed that they had a masm32 conversion for these examples, the tutorials start here:

http://nehe.gamedev.net/tutorial/lessons_01__05/22004/

then quickly realized the links were offline, but fortunately someone made a backup of most examples on github, including masm-converted ones, you can download them from here:

https://github.com/gamedev-net/nehe-opengl/

they used some definitions files that weren't included, luckily i found these .def files in the sources of a Northern Dragons' demogroup 4k intro named Trees, it was the only place to get them so i spread them here so you can compile and follow the great NeHe's tutorials!

gl.def

glu.def

please note that while these .def files are fairly complete, they don't have some opengl definitions; luckily the Trees' intro source also included the missing ones in an extra .def that i use too, here it is:

include.def

i made a example in masm using these .def too, the exe is 4kb unpacked but it features:

-screen scaling proportionally

-easy to customize resolutions

-fullscreen option that keeps the scaling ratio (set fullscreen to 1 in the .data group of the source)

-a colorful quad that takes the whole screen

-fairly minimal source to have a working pe-exe with opengl

screenshot

(the opengl that comes with windows 95/98 displays gouraud-shade like this, it looks different on more modern windows)

source

note that including .def files doesn't grow your exe file!

i hope the template is useful for anyone! :)

masm32-demo-template.zip

Edited by ViL
  • Like 2
Link to comment

seems i had the wrong idea when i though windows 95/98 opengl behaved differently when you used gouraud shade colors, after more tests and the help of a friend realized it happens when you use gouraud shade colors on quads in virtual machines only, i'm sorry for the misunderstanding above

here's more information on what happens, i haven't found anyone pointing this out before, a good workaround as shown there is using two triangles instead of a quad

cheers! :D

Edited by ViL
Link to comment

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
×
×
  • Create New...