Pardon the newbie-ness of the following question, but i was wondering how you could access the nVidia specific opengl extensions with win32asm. i took a look through the include and def files for standard OpenGL and without know a LOT about the API, i really don't understand how you could write these yourself. Thank you for any assistance.
Posted on 2002-01-06 06:16:03 by vikato
I have the same problems.... i use nvidia graphics card...ok and i use API functions for OpenGL in MASM but...its to slow! :-( ...so maby i dont use the right API functions or dont use the Graphics hardware accelrations at all...ehm..but im not sure...
Posted on 2002-01-14 07:53:40 by Froxxy
There is a sort of "OpenGL GetProcAddress" you need to use. I can't
remember the exact name of it, but go take a look at some OpenGL
tutorials (I can recommend NeHe's - they're good).
Posted on 2002-01-17 07:33:22 by f0dder
I will give you an example for multitexture:



invoke glGetString, GL_EXTENSIONS
;eax points to extensions string
invoke strstr, eax, CTEXT("GL_ARB_Multitexture")
.if eax != 0
;In this case wglGetProcAddress will get the address of the function glActiveTextureARB
invoke wglGetProcAddress, CTEXT("glActiveTextureARB")
mov glActiveTextureARB, eax
invoke wglGetProcAddress, CTEXT("glClientActiveTextureARB")
mov glClientActiveTextureARB, eax
.endif
Posted on 2002-01-17 12:41:01 by dxantos
thanx dxantos :-)
its a good idea to use.

if i want to get the "pure" address to the OpenGL extensionfunctions on my graphic card
i think i have to use wglGetProcAddress command...

i was reading this article ::
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glufnc01_9x0n.asp
Posted on 2002-01-31 07:28:34 by frooxy
sorry guys and gals!!

it should be more like

http://msdn.microsoft.com/library/en-us/opengl/ntopnglr_6yer.asp
the other one is useful to, but this is more what i have to read.
Posted on 2002-01-31 07:32:01 by froxxy
Good, but be sure to call glGetString to check if the extension is supported before calling wglGetProcAddress.

I dont know if its a 100% necesary, but since its only call during initialization, better be safe.
Posted on 2002-01-31 09:29:06 by dxantos
< my first post here :eek: >

Here is some code:


glPointParameterfvARB dd ?


invoke wglGetProcAddress, CTEXT("glPointParameterfvARB")
mov glPointParameterfvARB,eax


_glPointParameterfvARB MACRO a,b
gl_dpush b
gl_dpush a
mov eax, eax ; <- don't know why but seems to work bad without that sometimes
mov ecx, ecx ; <-
call glPointParameterfvARB
ENDM




when I use this , I obtain a nice memory access violation while "call" instruction . Note that my video card actually support this extension.
Any clue to help me ?
Posted on 2004-04-23 09:30:17 by Bounet
Have you checked the return value of wglGetProcAddress from a debugger?

BTW, both this instructions are actually NOPs (no-operations):
mov ecx,ecx

mov eax,eax

You can safely remove them as they are irrelevant. If your app is crashing, the problem has to be somewhere else...
Posted on 2004-04-23 15:14:09 by QvasiModo