I'm not sure what's going on. I thought z will be ignored due to sf::View setting ortho projection but it's not - if it's uploaded (hold Q) and large (hold E) then there will be nothing displayed.
I don't want to upload just 2 GL_FLOATs since I'm making a buffer of 3D vertices and then want to draw them 3 times from 3 sides with 3 different ortho projections (that I'll set myself in the GL_PROJECTION matrix but I want to get the common xy case 100% working and understood first).
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
int main()
{
sf::RenderWindow app(sf::VideoMode(800u, 600u), "gl");
app.setFramerateLimit(60u);
{
//get ortho sf::View applied
sf::Vertex v;
app.draw(&v, 1, sf::Points);
}
float trig[9] = {
0.f, 0.f, 0.f,
100.f, 100.f, 0.f,
100.f, 0.f, 0.f,
};
while(app.isOpen())
{
sf::Event eve;
while(app.pollEvent(eve))
{
if(eve.type == sf::Event::Closed)
app.close();
}//while app poll event eve
app.clear();
trig[2] = trig[2 + 3] = trig[2 + 6] = sf::Keyboard::isKeyPressed(sf::Keyboard::E) * 100.f;
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glVertexPointer(2 + sf::Keyboard::isKeyPressed(sf::Keyboard::Q), GL_FLOAT, sizeof(sf::Vector3f), trig);
glDrawArrays(GL_TRIANGLES, 0, 3);
app.display();
}
}