I currently have following code:
int pixelFormatIndex = 0;
int pixelCount = 0;
std::vector<int> pixAttribs;
// specify the important attributes for the pixelformat used by OpenGL
int standardAttribs[] = {
WGL_SUPPORT_OPENGL_ARB, 1, // Must support OGL rendering
WGL_DRAW_TO_WINDOW_ARB, 1, // pf that can run a window
WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB, // must be HW accelerated
WGL_RED_BITS_ARB, 8,
WGL_GREEN_BITS_ARB, 8,
WGL_BLUE_BITS_ARB, 8,
WGL_ALPHA_BITS_ARB, 8,
WGL_DEPTH_BITS_ARB, 16, // 16 bits of depth precision for window
//WGL_STENCIL_BITS_ARB, 8,
WGL_DOUBLE_BUFFER_ARB, GL_TRUE, // Double buffered context
WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, // pf should be RGBA type
0}; // NULL termination
pixAttribs.insert(pixAttribs.begin(),standardAttribs,standardAttribs+(sizeof(standardAttribs)/sizeof(int)));
// specify multisampling mode if it has been set
if(mMSMode != SLIMGF_MULTISAMPLING_OFF) {
pixAttribs.push_back(WGL_SAMPLES_ARB);
pixAttribs.push_back(mMSMode);
}
// OpenGL will return the best format for the pixel attributes defined above
BOOL result = wglChoosePixelFormatARB(mDeviceContext, pixAttribs.data(), NULL, 1, &pixelFormatIndex, (UINT*)&pixelCount);
ASSERT(result != false, "wglChoosePixelFormatARB() failed");
The problem is when im using WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB my screen just stays black and when im not using it my device created is Version 1.1.
I listed two picks with and without the hw support flag (info obtained by wglGetPixelFormatAttribivARB())
[attachment=13575:hwacc.png]
[attachment=13576:nohwacc.png]
The format with hardware support got a 24bit depth buffer and from some trying I thought that may have something to do with the problem allthough i dont know why.
Im using the newest version of GLEW that is succesfully intialized before.
My GPU is a GTX680.
I currently render with following test code:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glColor3f( 255, 0, 0 ); // red
glVertex3f(-1.0f, -0.5f, -5.0f);
glVertex3f(1.0f, -0.5f, -5.0f);
glVertex3f(0.0f, 0.5f, -5.0f);
glEnd();
I already thought about OpenGL4.2 causing problems with render this old way?
Thanks in advance