I have downloaded the sources of 0.5 stable version. I have compiled them and linked against the DirectX 9 SDK of December 2006.
Now I am sucessful compiling and linking with my "hello world" program for OpenGl, but when I execute the first two CEGUI calls I get a problem of insufficient memory:
Code: Select all
CEGUI::OpenGLRenderer *cegui_renderer = new CEGUI::OpenGLRenderer(0);
CEGUI::System *sys = new CEGUI::System(cegui_renderer); // Fails
Any ideas?
The complete program is the following:
Code: Select all
#include <Windows.h>
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <CEGUI.h>
#include <RendererModules/OpenGLGUIRenderer/openglrenderer.h>
void display ()
{
// clear framebuffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// draw teapot
glFrontFace(GL_CW);
glutSolidTeapot(2.5);
glFrontFace(GL_CCW);
// swap front and back buffers
glutSwapBuffers();
}
void reshape (int width, int height)
{
glViewport(0, 0, width, height);
}
void mouse (int button, int state, int x, int y)
{
}
void motion (int x, int y)
{
}
void main()
{
int argc = 1;
char* argv = "SampleApp";
glutInit(&argc, &argv);
glutInitDisplayMode(GLUT_DEPTH|GLUT_DOUBLE|GLUT_RGBA);
glutInitWindowSize(800, 600);
glutInitWindowPosition(100, 100);
glutCreateWindow("Crazy Eddie's GUI Mk-2 - Sample Application");
glutSetCursor(GLUT_CURSOR_NONE);
CEGUI::OpenGLRenderer *cegui_renderer;
cegui_renderer = new CEGUI::OpenGLRenderer(0);
CEGUI::System *sys = new CEGUI::System(cegui_renderer); // The memory allocation fails
// register callback functions
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMouseFunc(mouse);
glutMotionFunc(motion);
// hand over event processing to GLUT
glutMainLoop();
}