Author Topic: Now you can follow NeHe's tutorials in Masm! (gl.def, glu.def, include.def here)  (Read 482 times)

0 Members and 1 Guest are viewing this topic.

Offline ViL

  • Avocado lover 🥑
  • C= 64
  • **
  • Posts: 52
  • Karma: 1
    • View Profile
While looking at Nehe's tutorial for opengl i noticed that they had a masm32 conversion for these examples, the tutorials start here:

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:

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!



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:


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

edit: for some reason virtual machines inverts either quads color or vertices as unintendedly seen on the screenshot, a good workaround is to use two triangles instead of a quad, more information can be found here:


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

i hope the template is useful for anyone! :)
« Last Edit: June 30, 2018 by ViL »