Hello Community,
i want to use OpenGL
but when i run this modfied example.
#include <SFML/Window.hpp>
int main()
{
// Fenster erstellen
sf::Window App(sf::VideoMode(800, 600, 32), "OpenGL");
glClearDepth(1.f);
glClearColor(0.f, 0.f, 0.f, 0.f);
// Z - Buffer
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
// Projektion
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);
// Hauptschleife
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
{
App.Close();
}
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{
App.Close();
}
if (Event.Type == sf::Event::Resized)
{
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
}
}
App.SetActive();
// Fenster leeren
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.f, 0.f, -200.f);
glBegin(GL_POLYGON);
glVertex3f (0, 0, 0);
glVertex3f (25, 0, 0);
glVertex3f (0, 0, 25);
glVertex3f (25, 0, 25);
glEnd();
App.Display();
}
return EXIT_SUCCESS;
}
i get no picture only a black screen.
thx for help