Questions tagged [wgl]

53 questions
9
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,566
  • 18
  • 23
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
  • 43,567
  • 23
  • 113
  • 204
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 ==…
imallett
  • 13,288
  • 9
  • 49
  • 115
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
  • 70,450
  • 50
  • 199
  • 310
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,804
  • 2
  • 24
  • 38
4
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
  • 113
  • 1
  • 9
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
  • 686
  • 1
  • 6
  • 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
  • 2,858
  • 1
  • 26
  • 44
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
  • 113
  • 1
  • 9
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
  • 12,699
  • 9
  • 54
  • 65
2
votes
2 answers

Setting up OpenGL/Cuda interop in Windows

I am writing a DLL that needs to do some work in Cuda 3.2 and some work in OpenGL. OpenGL will render some grayscale images that my Cuda code needs to read in and modify, and then give back to OpenGL as a texture. I believe I need to create PBOs…
Alex
  • 21
  • 3
2
votes
0 answers

wglMakeCurrent with hdc parameter NULL

According to the registered here (khronos site): If the OpenGL context version of is 3.0 or above, and if either the parameter of wglMakeCurrent is NULL, or both of the and parameters of…
Mano-Wii
  • 562
  • 3
  • 18
2
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
  • 65
  • 6
2
votes
2 answers

does wglGetCurrentContext sync GPU and CPU?

when programming with OpenGL, glGet functions should be avoided because they force the GPU and CPU to synchronize, does this also apply to the wgl function "wglGetCurrentContext" which obtains a handle to the current OpenGL context? if not, are…
matthias_buehlmann
  • 3,414
  • 5
  • 26
  • 51
2
votes
1 answer

wglCreateContextAttribsARB returns NULL on capable hardware

I have a program which creates an OpenGL 4.0 context on a Windows machine. On my own computer, this code works - however, on my friend's computer, it does not. wglCreateContextAttribsARB returns NULL, even though my friend's Nvidia card supports…
NmdMystery
  • 2,618
  • 2
  • 27
  • 57
1
2 3 4