Guest User

Untitled

a guest
Jun 13th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. #include <SFML/Graphics.hpp>
  2. #include <iostream>
  3. #include <GL/glew.h>
  4. #include "utils.h"
  5. #include "vec3.h"
  6. #include "globals.h"
  7. #include "Viewport.h"
  8. #include "Input.h"
  9. #include "DummyListener.h"
  10.  
  11. int main() {
  12.     sf::ContextSettings settings;
  13.     settings.depthBits = 24;
  14.     settings.stencilBits = 8;
  15.     settings.antialiasingLevel = 0;
  16.     settings.majorVersion = 3;
  17.     settings.minorVersion = 3;
  18.  
  19.     window = new sf::Window(sf::VideoMode(800, 800) , "Hello window", 7u, settings );
  20.     glEnable(GL_DEPTH_TEST);
  21.     glClearDepth(1);
  22.     glDepthFunc(GL_LESS);
  23.     window->setFramerateLimit(30);
  24.  
  25.     glewInit();
  26.  
  27.     Mesh* mesh = loadMesh("assets/box.obj");
  28.  
  29.  
  30.     while (window->isOpen()) {
  31.         sf::Event event;
  32.         while(window->pollEvent(event)) {
  33.             if (event.type == sf::Event::Closed)
  34.                 window->close();
  35.             input.dispatchEvent(event);
  36.         }
  37.         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  38.         mesh->draw(vec3(), vec3());
  39.         window->display();
  40.     }
  41.  
  42.     return 0;
  43. }
Add Comment
Please, Sign In to add comment