Horde3D
http://www.horde3d.org/forums/

Debug assertion failed - Horde3D initialization
http://www.horde3d.org/forums/viewtopic.php?f=2&t=1242
Page 1 of 1

Author:  vines [ 11.09.2010, 03:53 ]
Post subject:  Debug assertion failed - Horde3D initialization

I am starting out with Horde3d so i may be doing this wrong,
Everytime i try to run my program i get this error : Image


Here is my code :
Code:
#include "Horde3D.h"

int main()
{
h3dInit();
bool run=true;
 h3dSetupViewport( 0, 0, 640, 480, true );
 H3DRes pipeRes = h3dAddResource( H3DResTypes::Pipeline, "standard.pipeline.xml", 0 );
H3DNode cam = h3dAddCameraNode( H3DRootNode, "Camera", pipeRes );
 while(run)
 {
   h3dRender( cam );
   
    // Finish rendering of frame
    h3dFinalizeFrame();
 }

h3dRelease();
return 0;
}


IDE : Micrososft visual c++ 2008 express
OS : Windows 7 Ultimate 32 bit
as you can see i borrowed some code from the basic tutorial and i am probably looping the program the wrong way but it was just a test to build a simple window.
But i dont see whats causing the error.


Thanks in advanced.

Author:  Volker [ 11.09.2010, 09:10 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

If the main routine is really the entry point of you application you have to make sure to create an OpenGL context BEFORE you call h3dInit.

Author:  AlexL [ 11.09.2010, 09:10 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

If this is your whole program, then you're completely missing the window/GL context creation part.
You need to have a valid GL Context before you can call h3dInit.
Horde's examples use the GLFW library to set up a window/GL environment (see the Knight example code).
If you're familiar with a another window/gl lib, this will do as well (SFML, glut).

Author:  vines [ 11.09.2010, 18:36 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

I tried the whole day tring to do it, how do i make the simple Openggl context and assign it to horde3d?

[edit]
Is this the right way for making the context ? (i made it with glut)
Code:
void RenderScene(void)
{
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
// Flush drawing commands
glFlush();
}
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutCreateWindow("Simple");

glutDisplayFunc(RenderScene);

glutMainLoop();

Author:  AlexL [ 11.09.2010, 18:47 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

Use the Knight example and strip out unneeded code, step by step.

Author:  vines [ 11.09.2010, 21:59 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

I dont know opengl so i really dont understand which code is which, can you pleas show me a example of how to make the opengl context and bind it to Horde3d.


Thanks in advanced.

Author:  MistaED [ 13.09.2010, 02:19 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

Hi vines,

When you look at the knight example, you have main.cpp, app.cpp & app.h. Think of main.cpp as the "server" of the context, as this code is dedicated to just setting up GLFW (which is your OpenGL initializer & window/input manager for your operating system). This code also is in charge of creating the class inside of app.cpp which takes care of horde3d and the code specific for the knight sample (which could be considered the client of the server). If I were you, I'd just modify app.cpp & app.h and leave main.cpp as it is, and only modify main.cpp if you need a specific option set like a different resolution or whatever.

When you're more confident, I would suggest seeing if glfw is ideal for what you want to do, and if not there are alternative libraries for opengl context-creation here: http://horde3d.org/wiki/index.php5?title=Horde3D_Wiki:Community_Portal#Programming_Guide under the "Tutorial - Setup Horde3D with <insert lib here>" links.

A good indicator to see what is what, opengl-specific code usually has the gl prefix, glfw has the glfw prefix, and horde3d has the h3d prefix. More than likely you won't need to issue any gl prefixed commands because horde3d handles this for you, and the same for context-creation which glfw handles.

Author:  vines [ 13.09.2010, 02:43 ]
Post subject:  Re: Debug assertion failed - Horde3D initialization

Thank you very much

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/