ウィンドウがopenglに表示されない(glfwおよびglew)


0

こんにちは私は私のopenGlウィンドウを表示させるのに問題があります。 ms-vs 2015から起動すると、空白のウィンドウがすばやく開閉します。

#include <iostream>
#include <GL\glew.h>
#include <GLFW\glfw3.h>

// WINDOW DIMENSIONS
const GLint WIDTH = 300, HEIGHT = 600;

using namespace std;

int main() {

// INITIALIZE GLFW
if (!glfwInit()) {
    printf("GLFW Initialization Failed! ");
    glfwTerminate();
    return 1;
}

// GLFW WINDOW PROPERTIES
// OpenGL VERSION
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
// CORE PROFILE = NOT BACKWARDS COMPATIBLE
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
// ALLOW FORWARD COMPATABILITY
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

GLFWwindow *mainwindow = glfwCreateWindow(WIDTH, HEIGHT, "test window", NULL, NULL);
if (!mainwindow) {
    printf("GLFW Window Creation Failed! ");
    return 1;
}

// GET BUFFER SIZE INFORMATION
int bufferWidth, bufferHeight;
glfwGetFramebufferSize(mainwindow, &bufferWidth, &bufferHeight);

// Set Context For GLEW To Use
glfwMakeContextCurrent(mainwindow);

// Allow Modern Extension Features
glewExperimental = GL_TRUE;

if (glewInit() != GLEW_OK) {
    printf("GLEW Initialization Failed! ");
    glfwDestroyWindow(mainwindow);
    glfwTerminate();
}

// Setup Viewport Size
glViewport(0, 0, bufferWidth, bufferHeight);

// Loop Until Window Closed
while (glfwWindowShouldClose(mainwindow)) {
    // Get And Handle Events
    glfwPollEvents();

    // Clear Window
    glClearColor(1.0f, 0, 0, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);

    glfwSwapBuffers(mainwindow);
}

return 0;
}

そしてデバッグログは示します

'GLFW.exe' (Win32): Loaded 'C:\Users\wezte\Documents\Visual Studio 2015\Projects\GLFW\Debug\GLFW.exe'. Symbols loaded.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Program Files\AVG\Antivirus\aswhookx.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Users\wezte\Documents\Visual Studio 2015\Projects\GLFW\Debug\glew32.dll'. Module was built without symbols.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dinput8.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\XInput1_4.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\hid.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\igdlh64.inf_amd64_ca615c91f47053ea\ig9icd32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wtsapi32.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'GLFW.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\version.dll'
'GLFW.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\igdlh64.inf_amd64_ca615c91f47053ea\igc32.dll'. Cannot find or open the PDB file.
The thread 0x22d8 has exited with code 0 (0x0).
The thread 0x23d0 has exited with code 0 (0x0).

The thread 0x3168 has exited with code 0 (0x0).
The program '[10460] GLFW.exe' has exited with code 0 (0x0).

注意してください私はそれが4.4までのopenglコアプロファイルをサポートしていると言っているIntel 660 i5 7th genを使用しています


あなたはそれらのいずれかを打っていますか printf() の?
genpfault

戻りコードは0なので、最も可能性の高い問題は、 glewInit() 失敗しました。
derhass

あなたは私がそれを解決することができる方法について何か考えがありますか?
rial
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.