Hallo Forum,
ich wollte ein OpenGL Kontext erstellen (3.x OpenGL) leider gibt die Funktion wglewIsSupported keinen Rückgabewert aus und bei glewInit kriege ich die Fehlermeldung 1282.
Hier der Code:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
GLenum err = glewInit();
if(err != GLEW_OK) {
// error happened
std::cout << "glew failed to load" << std::endl;
return;
}
std::cout << "OpenGL error: " << glGetError() << std::endl; // OpenGL error code 1282 GL_INVALID_OPERATION
int attribs[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 3,
WGL_CONTEXT_FLAGS_ARB, 0,
0
};
if(wglewIsSupported("WGL_ARB_create_context") == 1) {
// Make a OpenGL 3.x context.
wglMakeCurrent(NULL, NULL);
wglDeleteContext(*hRC);
*hRC = wglCreateContextAttribsARB(*hDC, 0, attribs);
wglMakeCurrent(*hDC, *hRC);
std::cout << "created a 3.x OpenGL context" << std::endl;
} else {
// It's not possible to make a GL 3.x context.
}
|
Ich höffe ihr könnt mir helfen. Langsam bin ich echt am Verzweifeln...
MfG
Delop