• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1943
  • Last Modified:

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.
0
RonHoffmann
Asked:
RonHoffmann
  • 3
  • 2
  • 2
  • +1
4 Solutions
 
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
 
collerbladeCommented:
DWORD is good, because the handle is a simple integer.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
RonHoffmannAuthor Commented:
Point increase for sharing
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now