Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- #include <iostream>
- #include <GL/glew.h>
- #include "utils.h"
- #include "vec3.h"
- #include "globals.h"
- #include "Viewport.h"
- #include "Input.h"
- #include "DummyListener.h"
- int main() {
- sf::ContextSettings settings;
- settings.depthBits = 24;
- settings.stencilBits = 8;
- settings.antialiasingLevel = 0;
- settings.majorVersion = 3;
- settings.minorVersion = 3;
- window = new sf::Window(sf::VideoMode(800, 800) , "Hello window", 7u, settings );
- glEnable(GL_DEPTH_TEST);
- glClearDepth(1);
- glDepthFunc(GL_LESS);
- window->setFramerateLimit(30);
- glewInit();
- Mesh* mesh = loadMesh("assets/box.obj");
- while (window->isOpen()) {
- sf::Event event;
- while(window->pollEvent(event)) {
- if (event.type == sf::Event::Closed)
- window->close();
- input.dispatchEvent(event);
- }
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- mesh->draw(vec3(), vec3());
- window->display();
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment