jeudi 26 février 2015

Freeglut error: fgInitGL2: fghGenBuffers is NULL

I'm transferring a program from OSX to Windows, but one error is still nagging me. The error occurs during run-time in gdb. Compiling and linking goes all fine.



freeglut (C:\path\to\file.exe): fgInitGL2: fghGenBuffers is NULL



Outside the GDB environment it gives an APPCRASH (windows-shell) or Segmentation fault (mingw64-shell).


My linker flags are:



-std=c++11 -lstdc++ -lz -lm -lmysqlcleint -lpthread -lboost_thread-mgw49-mt-d-1_57 -lboost_system-mgw49-mt-d-1_57 -lboost_regex-mgw49-mt-d-1_57 -lcurl -lfreeglut -lglu32 -lopengl32 -lws2_32 -lwsock32 -U__CYGWIN__



I'm working in msys2 mingw-w64. During runtime, the program tries to open a new window (at least a pictogram rices in the windows taskbar), but the construction of the window won't succeed. The program runs fine on OSX, where I use glut instead of freeglut.


Header (amongst others):



#include <direct.h>
#include <GL/glut.h>
#include <GL/freeglut.h>


CPP (amongst others):



void interface::startInterface(int &argc, char **argv){

glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize (width, height);
glutInitWindowPosition (1920, 0);
glutInit (&argc, argv);
glutCreateWindow ("TIFAR 2.0");


LoadGLTextures(); // Load The Texture(s) ( NEW )
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // This Will Clear The Background Color To Black
glClearDepth(1.0); // Enables Clearing Of The Depth Buffer
glDepthFunc(GL_LESS); // The Type Of Depth Test To Do
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); // Reset The Projection Matrix

gluPerspective(45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f);
// Calculate The Aspect Ratio Of The Window

glMatrixMode(GL_MODELVIEW);

glutDisplayFunc (interface::display);
glutReshapeFunc (interface::reshape);
glutIdleFunc (interface::idle);
glutKeyboardFunc (interface::processNormalKeys);

glutMainLoop();
}


There are some other parts in the program, like where images are loaded, but I think it will be to much information when I mention everything here.


Hope you can help me further; any help will be appreciated.


~Mart


Aucun commentaire:

Enregistrer un commentaire