Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Minastir

Pages: [1]
1
Graphics / Re: Using Graphics module with OpenGL
« on: August 23, 2017, 10:02:07 pm »
Ok thank you.
This fixed the problem.
I don't even need to do glDisableClientState anymore.
I guess now I just have to be careful to restore all states I change after drawing with OpenGL.

2
Graphics / Using Graphics module with OpenGL
« on: August 22, 2017, 11:43:26 pm »
Hello, I've used SFML in the past for 2d projects and decided to use it with OpenGL to learn 3d programming as well.
My goal is to make a program that renders a simple scene in overhead 2d, simple 3d projection using the SFML 2d graphics module and "real" 3d with OpenGL.
I started following the tutorial on http://www.opengl-tutorial.org/ but I immediately ran into problems.
I dug around on different forums for solutions and while adding
Code: [Select]
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
In the code after popGLStates() stopped my program from crashing, I still can't draw anything with the graphics module if I initialize drawing in OpenGL.
I isolated the problem into this piece of code.
Code: [Select]
GLfloat g_vertex_buffer_data[] = { -1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f, };
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW);
If I run this, which apparently generates a VBO, puts some data into it and binds it for use, the graphics module stops doing anything, even if I use pushGLStates().
I'm sorry if this question is silly, but I'm a beginner with using OpenGL and I will appreciate any help you can give me.

Pages: [1]
anything