added proper license in core various poking into getting context > system > renderer properly setup
This commit is contained in:
parent
c7c7d5af77
commit
3cc0fde1e1
25 changed files with 628 additions and 236 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "pw/visual/context.hpp"
|
||||
#include "pw/system/input.hpp"
|
||||
#include "pw/core/debug.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <locale>
|
||||
|
@ -98,10 +99,36 @@ struct window::impl {
|
|||
|
||||
impl()
|
||||
{
|
||||
// initialize
|
||||
glfwInit();
|
||||
|
||||
// request specific version 3.2
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
|
||||
|
||||
//
|
||||
_window = glfwCreateWindow(640, 480, "pixwerxs", nullptr, nullptr);
|
||||
|
||||
// check Version
|
||||
int major, minor, rev;
|
||||
major = glfwGetWindowAttrib(_window, GLFW_CONTEXT_VERSION_MAJOR);
|
||||
minor = glfwGetWindowAttrib(_window, GLFW_CONTEXT_VERSION_MINOR);
|
||||
rev = glfwGetWindowAttrib(_window, GLFW_CONTEXT_REVISION);
|
||||
|
||||
|
||||
// maybe something to pass to the outside
|
||||
// debug::d() << "OpenGL " << major << "." << minor << "." << rev;
|
||||
|
||||
|
||||
// if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
|
||||
// {
|
||||
// debug::e() << "G";
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
glfwSetWindowUserPointer(_window,this);
|
||||
|
||||
glfwSetFramebufferSizeCallback(_window, window::impl::framebuffer_size_callback);
|
||||
|
@ -117,7 +144,6 @@ struct window::impl {
|
|||
glfwSetScrollCallback(_window, scroll_callback);
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
glfwMakeContextCurrent(_window);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue