flat assembler
Message board for the users of flat assembler.

Index > Windows > OpenGL Extensions

Author
Thread Post new topic Reply to topic
Rbraz



Joined: 08 Oct 2006
Posts: 2
Rbraz 10 Oct 2006, 00:13
Hello,

I'm coding a little OpenGL program in FASM and I need to add "wglSwapIntervalEXT" function and disable/enable vertical synch.

Does anyone know how to convert this C code into FASM ?

Code:
typedef void (APIENTRY *PFNWGLEXTSWAPCONTROLPROC)(int);
static PFNWGLEXTSWAPCONTROLPROC wglSwapIntervalEXT = NULL;

wglSwapIntervalEXT = (PFNWGLEXTSWAPCONTROLPROC)wglGetProcAddress("wglSwapIntervalEXT");    


Any help will be much appreciated Smile

Rbraz
Post 10 Oct 2006, 00:13
View user's profile Send private message Reply with quote
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin 10 Oct 2006, 07:35
havent tested it, but i imagine like this

Code:
wglSwapIntervalEXT_Name db "wglSwapIntervalEXT", 0
wglSwapIntervalEXT rd 1

push wglSwapIntervalEXT_Name
invoke wglGetProcAddress
mov [wglSwapIntervalEXT], eax

; wglSwapIntervalEXT is defined as a function pointer
; to call it...
call [wglSwapIntervalEXT]
    
Post 10 Oct 2006, 07:35
View user's profile Send private message Reply with quote
Rbraz



Joined: 08 Oct 2006
Posts: 2
Rbraz 10 Oct 2006, 15:49
Thank you very much wisepenguin, it works fine Smile


Code:
stdcall [wglSwapIntervalEXT],1  ; to enable OGL vertical sync
stdcall [wglSwapIntervalEXT],0  ; to disable OGL vertical sync    
Post 10 Oct 2006, 15:49
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.