Author Topic: Now you can follow NeHe's tutorials in Masm! (gl.def, glu.def, include.def here)  (Read 176 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:
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
https://pastebin.com/raw/tq3TJVpf

glu.def
https://pastebin.com/raw/KwM8EjcT

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
https://pastebin.com/raw/NTh58nXp

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
https://i.imgur.com/iIcEUNm.gif
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: http://www.dbfinteractive.com/forum/index.php?topic=6773.msg84335

source
https://pastebin.com/raw/Kns0FqBQ

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 »