Questions tagged [wgl]
58 questions
10
votes
1 answer
Why are functions duplicated between opengl32.dll and gdi32.dll?
The following functions are duplicated between opengl32.dll and gdi32.dll:
[opengl32.dll] / [gdi32.dll]
wglChoosePixelFormat / ChoosePixelFormat
wglDescribePixelFormat / DescribePixelFormat
wglGetPixelFormat /…

The Fiddler
- 2,726
- 22
- 28
7
votes
3 answers
Minimal Windowless OpenGL Context Initialization
How can I initialize a windowless OpenGL context with the minimal amount of code?
I've read here that you can use wglCreateContextAttribsARB to create windowless context, however it doesn't explain how?

ronag
- 49,529
- 25
- 126
- 221
5
votes
0 answers
GetLastError for [ARB/]WGL Errors
It seems that certain API-specific calls set the error returned by GetLastError(). For example, wglCreateContextAttribsARB(...) can return (information from the specification):
ERROR_INVALID_VERSION_ARB == 0x2095
ERROR_INVALID_PROFILE_ARB ==…

geometrian
- 14,775
- 10
- 56
- 132
5
votes
1 answer
wglGetProcAddress returns NULL
I was trying to use WGL_ARB_pbuffer for offscreen rendering with OpenGL,
but I was failed during initialization.
Here is my code.
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)…

phraust
- 123
- 1
- 9
5
votes
1 answer
WGL: No double buffering + multi sampling = FAIL?
I usually create a pixel format using wglChoosePixelFormatARB() with these arguments (among others):
WGL_DOUBLE_BUFFER_ARB = GL_TRUE
WGL_SAMPLE_BUFFERS_ARB = GL_TRUE
WGL_SAMPLES_ARB = 4
i.e. double buffering on and x4 multisampling. This works just…

shoosh
- 76,898
- 55
- 205
- 325
4
votes
2 answers
Request the most recent version of OpenGL context
I'm developing an application that can use any OpenGL version from 4.6 down to 2.0 by gradually disabling some features and optimizations. This means that it can live with 2.0 but prefers the latest supported version to be able to use all the…

devoln
- 396
- 4
- 12
4
votes
1 answer
OpenGL 1.0 and 1.1 Function Pointers on Windows
I'm a bit confused about the nature of OpenGL 1.0 and 1.1 function pointers on Windows. I think I have it down, but I'm not 100% sure, so I'm hoping that someone will be able to confirm or comment on my current understanding:
My understanding at the…

fieldtensor
- 3,972
- 4
- 27
- 43
3
votes
1 answer
How OpenGL ICD on Windows Loads OpenGL 1.0 and 1.1 Functions?
Recently I've been doing research on how OpenGL graphics drivers (ICD) implement OpenGL functions called by OpenGL runtime (opengl32.dll) on Windows.
I understand that I can use the GetProcAddress to get the function pointers of OpenGL 1.0 and 1.1…

ZP2016
- 31
- 1
3
votes
1 answer
Create Modern OpenGL context using WGL?
I'm trying to create an OpenGL context (Modern Version) using Windows functions.
Basically the code is just:
Create window class
Register the class
create a Window
choose PIXELFORMATDESCRIPTOR & set it
Create a legacy OpenGL context
Make context…

Popo Heche
- 75
- 1
- 7
3
votes
1 answer
changing GLUT calls to work with MFC/C++
I have a program that uses GLUT for its OpenGL rendering. Now I need it to be inside of a MFC project so that it can work with another program component.
I've followed this tutorial:…

laurenelizabeth
- 786
- 1
- 7
- 19
3
votes
1 answer
Multiple windows with shared context
I currently have an implementation that works on all video cards except Mobile Intel GM45. Unfortunately, when I attempt to call wglMakeCurrent(sDC, sRC); on said video card, it crashes completely. I do not have physical access to this video…

Mike Weir
- 3,094
- 1
- 30
- 46
3
votes
0 answers
I have trouble with WGL_ARB pbuffer of OpenGL
I was trying to do off-screen rendering with WLG_ARB pbufer,
but I got trouble with wglCreatePbufferARB()
It always returns NULL.
Here is a part of the code.
bool COpenGLWnd::OffscreenRender
(/* IN parameters */ int transitionID, int counts, int…

phraust
- 123
- 1
- 9
2
votes
2 answers
Why does this OpenGL + WIN32 code produce Vertical lines?
To be clear, I've extensively tested this code and found the issue is somewhere with the code written prior to the WGL code. It's precisely in the WIN32 code. Now I think it could partially be caused by calling gluOrth2D but even then, that…

Jack Benson
- 107
- 1
- 8
2
votes
1 answer
Correct usage of wglMakeCurrent?
Is wglMakeCurrent supposed to be called only once or does it need to be called before every buffer swap?
Can current opengl context be reset by some external thing other then setting it via wglMakeCurrent?
I am here just to narrow the possible…

Etwus
- 549
- 5
- 15
2
votes
2 answers
How to properly setup OpenGL scene for visualizing single objects
I need to write a simple visualizer for my mesh toolkit. The objects I'm working with is always located inside [-1,1]^3 box (inclusive), so I need to ensure that object will be entirely visible by user. I also want to have a possiblity to rotate a…

okutane
- 13,754
- 10
- 59
- 67