flat assembler
Message board for the users of flat assembler.

Index > Windows > OpenGL with GLEW and GLFW in assembly?

Author
Thread Post new topic Reply to topic
wbutterdog



Joined: 01 Oct 2025
Posts: 7
wbutterdog 01 Oct 2025, 19:08
Hello everyone.
I recently started a little project..creating a 3d engine using assembly. I decided to use FASM of course for this project. However, I have run into a problem. I need (want) to be able to use modern OpenGL functions and extensions such as; [glGenBuffers].
However, as you may know, those are extensions from more modern versions, ie NOT the version 1.1 that is installed on my system: opengl32.dll (the windows binary)

Short version of my question: How can I access these modern functions?

Longer version because I'm not entirely stupid: How can I correctly link, initialize and build an OpenGL context with GLEW and GLFW in 64bit assembly using FASM? Should I use static libraries? dll's? How can I include the c and c header files from GLEW for example?? Or am I missing the ball entirely?

Thank you for reading. Very Happy
Post 01 Oct 2025, 19:08
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1185
Location: Russia
macomics 01 Oct 2025, 20:39
wbutterdog wrote:
How can I access these modern functions?

Here
In short:
    Create a 1.1 context and get the extension string via glGetString

    Check for the WGL_ARB_create_context extension

    Use wglGetProcAddress to get a pointer to wglCreateContextAttribsARB

    Delete the old 1.1 context and create a new one of the required version via wglCreateContextAttribsARB

    Import a set of functions for the context of the corresponding version and all available/used extensions via wglGetProcAddress
Post 01 Oct 2025, 20:39
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.