#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
int main()
{
sf::ContextSettings settings;
settings.majorVersion = 3;
settings.minorVersion = 3;
settings.attributeFlags = sf::ContextSettings::Core;
sf::Window window(sf::VideoMode(800, 600), "Helicopter Simulator", sf::Style::Default, settings);
if (!sf::Shader::isAvailable())
{
std::cerr << "Shaders are unavailable" << std::endl;
}
std::cout << "SFML Using OpenGL: " << window.getSettings().majorVersion << "." << window.getSettings().minorVersion << std::endl;
std::cout << "OpenGL Version: " << glGetString(GL_VERSION) << std::endl;
std::cout << "GLSL Version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl;
sf::Shader cubeShader;
if(!cubeShader.loadFromFile("Shaders/cube.vert", "Shaders/cube.frag"))
{
std::cerr << "ERROR: Failed to load shader" << std::endl;
}
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
window.display();
}
return 0;
}