| Pickle Gunner (107) | |||||||||||
|
So I have been making a voxel engine using sfml and the opengl that comes with it. Now what I have been aiming for at this step (Which, however easy, has confused me) is to render cube comprised of 27 smaller cubes. However what I have been noticing is, even though all 27 cubes are rendering only one is colored. Since, when I rotate the entire cube structure, when the single colored cube reaches the back it is covered by a mass of black cubes. I have looked over my code for a couple hours and tested many solutions which have all failed, but I still can't seem to locate the problem. Main.cpp:
Window.cpp
Window.hpp
RenderBlock.cpp
RenderBlock.hpp
-I used #pragma once because of #ifdef's were not working for me strangely- | |||||||||||
|
Last edited on
|
|||||||||||
| helios (10258) | |||||
Your rendering process looks like this:
| |||||
|
Last edited on
|
|||||
| Pickle Gunner (107) | |
| I tried moving the clear buffer out before, but it just gave me blackness. Why would I need to swap the buffers, does sfml enable double buffering automatically? | |
|
|
|
| cire (2356) | |||||
|
What's with the two windows? In main:
Where Render is defined as:
One of the windows is never created, but you use it as if it were. | |||||
|
|
|||||
| Pickle Gunner (107) | |
|
What do you mean? I don't understand what you are trying to say. Those are just objects. Render_Window Is a object in RenderBlock to the class Window Main_Window Is a object in Main to the class Window Main_Render Is a object in Main to the class RenderBlock I was trying to ask what is the GL command for swapping the buffers? | |
|
|
|
| cire (2356) | |
|
The buffers are swapped when you call display() on your sf::Window(s) (of which you have two.) Documented at: http://sfml-dev.org/tutorials/2.0/window-opengl.php under "A typical OpenGL-with-SFML program." | |
|
|
|
| Pickle Gunner (107) | |
|
Yeah, I just figured that out, and was writing a post to say never mind :) . Thanks any way cire and helios for the help. I was using this https://sites.google.com/site/letsmakeavoxelengine/home/basic-block-rendering just because its written in his own opengl wrapper, so its just like a big page full of psuedo-code. | |
|
|
|