add basic example

This commit is contained in:
viperscape
2018-11-15 17:02:20 -05:00
parent 764bcb5a8a
commit 0ddfaead8f
11 changed files with 415 additions and 0 deletions

27
examples/basic/window.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include "window.h"
Window::Window(int x, int y, const char* title)
{
GLFWwindow* window = glfwCreateWindow(x, y, title, NULL, NULL);
this->window = window;
}
Window::~Window()
{
glfwDestroyWindow(this->window);
}
void Window::Resize()
{
GLint w, h;
glfwGetWindowSize(this->window, &w, &h);
glViewport(0, 0, w, h);
}
int Window::Close()
{
return glfwWindowShouldClose(this->window);
}