Here's the sample program:
Code:
#include"Horde3D.h"
#include<GL/glew.h>
#include<GL/gl.h>
#include<SDL2/SDL.h>
#include"Horde3DUtils.h"
int main() {
SDL_Window* window = SDL_CreateWindow("Window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL);
SDL_GLContext glctx = SDL_GL_CreateContext(window);
glewExperimental = false;
glewInit();
h3dInit(H3DRenderDevice::OpenGL2);
H3DRes pipeRes = h3dAddResource(H3DResTypes::Pipeline, "pipeline.xml", 0);
h3dutLoadResourcesFromDisk("");
H3DNode cam = h3dAddCameraNode(H3DRootNode, "Camera", pipeRes);
h3dSetNodeParamI( cam, H3DCamera::ViewportXI, 0 );
h3dSetNodeParamI( cam, H3DCamera::ViewportYI, 0 );
h3dSetNodeParamI( cam, H3DCamera::ViewportWidthI, 640 );
h3dSetNodeParamI( cam, H3DCamera::ViewportHeightI, 480 );
h3dSetupCameraView( cam, 45.0f, (float)640 / 480, 0.5f, 2048.0f );
h3dResizePipelineBuffers( pipeRes, 640, 480 );
h3dRender(cam);
h3dFinalizeFrame();
SDL_GL_SwapWindow(window);
SDL_Delay(1000);
return 0;
}
The above is compiled with: "g++ h3d.cpp -lSDL2main -lSDL2 -lHorde3D -lHorde3DUtils -lGLEW -lGL"
When I mean "not rendering", I don't mean a black screen, not even that is rendered, it's a mangled version of what was behind the window before it was made. So not even the buffer is cleared.
The pipeline used is the exact same as "forward.pipeline.xml" used in the sample files.
Another strange thing is APITrace's output:
Code:
1149 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1150 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1151 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1152 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1153 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1154 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1155 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1156 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1157 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1158 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1159 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1160 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1161 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1162 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1163 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1164 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1165 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1166 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1167 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1168 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1169 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1170 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1171 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1172 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1173 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1174 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1175 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1176 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1177 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1178 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1179 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1180 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1181 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1182 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1183 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1184 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1185 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1186 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1187 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1188 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1189 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1190 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1191 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1192 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1193 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
1194 glBindTexture(target = GL_TEXTURE_CUBE_MAP, texture = 0)
1195 glBindTexture(target = GL_TEXTURE_3D, texture = 0)
1196 glBindTexture(target = GL_TEXTURE_2D, texture = 0)
Seemingly unnecessary GL calls are being done every frame.