Where is HGLRC (opengl handle to render context) defined ?????

I'm porting some opengl code to assembler, I'm using winasm (masm).
I'm using opengl32.inc, glu32.inc, opengl23.lib and glu32.lib
I can't find where the opengl render context handle type is defined (HGLRC) I can't seem to get the code working without it. I've tried declaring it as a DWORD as most handles are but it doesn't work.
LVL 4
RonHoffmannAsked:
Who is Participating?
 
RonHoffmannAuthor Commented:
Point increase for sharing
0
 
jb1devCommented:

Is it here:

http://pyglet.googlecode.com/svn/trunk/tools/wgl.h

typedef void *HANDLE;
#define DECLARE_HANDLE(name) typedef HANDLE name
DECLARE_HANDLE(HGLRC);
DECLARE_HANDLE(HDC);

0
 
RonHoffmannAuthor Commented:
Thanks that's great.
would you know if there is an assembler version of the file wgl.inc
It would save me a lot of time converting from the .h.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
collerbladeCommented:
DWORD is good, because the handle is a simple integer.
0
 
jb1devCommented:
> would you know if there is an assembler version of the file wgl.inc

Not sure about assembler. Can't you just use the equivalent of the above typedef code?


0
 
ikeworkCommented:
Hey RonHoffmann,

the OpenGL lessons at nehe all have an asm-ports:

  http://nehe.gamedev.net/

Here is lesson 2 "Your first Polygon" in assembler, including headers:

  http://nehe.gamedev.net/data/lessons/asm/lesson02.zip

Here is the actual lesson:

  http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=02


Hope it helps :)
ike
0
 
ikeworkCommented:
Here is how they store the return value of wglCreateContext, the "HGLRC hRC;"

the handles are declared here:

  hDC      dd ?
  hRC      dd ?

and hRC is initialized here:

@@9:
      push [hDC]
      call wglCreateContext
      or eax,eax
      jnz @@10
      call KillGLWindow
      push MB_OK or MB_ICONEXCLAMATION
      push offset ER
      push offset CCRC
      push L 0
      call MessageBox
      mov ax,-1
      ret
@@10:
      mov hRC,eax
0
 
RonHoffmannAuthor Commented:
after digging deeper... a lot deeper
I think the problem I'm having is with my inc and lib files.
specifically glu32.inc and glu32.lib
the function ordinals don't match up and the inc file has twice as many arguments as necessary defined for each function.
I'll try reinstalling masm and winasm ide
I guess what I really need is a matched set of glu32 files ( .inc, .lib, .dll ) unless my assembler/linker are messed up.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.