slowly getting tracktion again
This commit is contained in:
parent
a5dea1ede1
commit
dd23fa811a
29 changed files with 685 additions and 380 deletions
|
@ -1 +1,23 @@
|
|||
add_subdirectory(src)
|
||||
#add_subdirectory(src)
|
||||
|
||||
set(hdrs
|
||||
include/pw/ui/window.hpp
|
||||
)
|
||||
|
||||
set(srcs
|
||||
src/window.cpp
|
||||
)
|
||||
|
||||
add_library(pwui
|
||||
STATIC
|
||||
${hdrs}
|
||||
${srcs}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
pwui
|
||||
PUBLIC
|
||||
include
|
||||
)
|
||||
|
||||
target_link_libraries(pwui pwcore glfw glad)
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
set(hdrs
|
||||
../include/pw/ui/window.hpp
|
||||
)
|
||||
|
||||
set(srcs
|
||||
window.cpp
|
||||
)
|
||||
|
||||
|
||||
add_library(pwui
|
||||
STATIC
|
||||
${hdrs}
|
||||
${srcs}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
pwui
|
||||
PUBLIC
|
||||
../include
|
||||
)
|
||||
|
||||
target_link_libraries(pwui pwcore glfw glad)
|
|
@ -2,14 +2,16 @@
|
|||
|
||||
//#include "glad/glad.h"
|
||||
|
||||
pw::window::window() {
|
||||
pw::window::window()
|
||||
{
|
||||
glfwInit();
|
||||
|
||||
_window = glfwCreateWindow(640, 480, "pixwerxs", NULL, NULL);
|
||||
_window = glfwCreateWindow(640, 480, "pixwerxs", nullptr, nullptr);
|
||||
|
||||
#if 0
|
||||
glfwMakeContextCurrent(_window);
|
||||
glfwMakeContextCurrent(_window);
|
||||
|
||||
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -17,45 +19,41 @@ pw::window::window() {
|
|||
|
||||
pw::window::~window() {
|
||||
|
||||
glfwDestroyWindow(_window);
|
||||
glfwDestroyWindow(_window);
|
||||
}
|
||||
|
||||
bool pw::window::update()
|
||||
{
|
||||
if (!glfwWindowShouldClose(_window)) {
|
||||
if (!glfwWindowShouldClose(_window)) {
|
||||
|
||||
// do other stuff
|
||||
// do other stuff
|
||||
#if 0
|
||||
glClearColor(1,0,0,1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClearColor(1,0,0,1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
#endif
|
||||
|
||||
glfwSwapBuffers(_window);
|
||||
glfwPollEvents();
|
||||
glfwSwapBuffers(_window);
|
||||
glfwPollEvents();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void pw::window::set_title(const char *t)
|
||||
{
|
||||
glfwSetWindowTitle(_window,t);
|
||||
glfwSetWindowTitle(_window,t);
|
||||
}
|
||||
|
||||
void pw::window::set_size(int w,int h) {
|
||||
glfwSetWindowSize(_window,w,h);
|
||||
glfwSetWindowSize(_window,w,h);
|
||||
}
|
||||
|
||||
//void pw::window::load(sol::table &ns)
|
||||
//{
|
||||
// glfwInit();
|
||||
//
|
||||
|
||||
|
||||
// ns.new_usertype<window>("window",
|
||||
// "update",&window::update,
|
||||
// "set_title",&window::set_title,
|
||||
// "set_size",&window::set_size
|
||||
// );
|
||||
//}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue