added glad generator and a glad runtime
This commit is contained in:
parent
2017f6195e
commit
ac18a84a9c
62 changed files with 32373 additions and 10 deletions
|
@ -3,6 +3,9 @@
|
|||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../deps/glfw-3.2.1/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../deps/lua-5.3.4/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../deps/glad/include
|
||||
|
||||
|
||||
)
|
||||
|
||||
add_library(pw
|
||||
|
|
|
@ -30,7 +30,8 @@ void pw::context::yield()
|
|||
void pw::context::script(const char *s)
|
||||
{
|
||||
_lua.script("w = pw.window.new()");
|
||||
_lua.script("w:set_title(\"pixwerks\")");
|
||||
_lua.script("w:set_title(\"pixwerks alpha\")");
|
||||
_lua.script("w:set_size(320,240)");
|
||||
_lua.script("while w:update() do end");
|
||||
// luaL_loadstring(_state,s);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
pw::window::window() {
|
||||
|
||||
_window = glfwCreateWindow(640, 480, "pixwerxs", NULL, NULL);
|
||||
|
||||
}
|
||||
|
||||
pw::window::~window() {
|
||||
|
@ -31,13 +32,18 @@ void pw::window::set_title(const char *t)
|
|||
glfwSetWindowTitle(_window,t);
|
||||
}
|
||||
|
||||
void pw::window::load(sol::table &ns) {
|
||||
{
|
||||
glfwInit();
|
||||
|
||||
ns.new_usertype<window>("window",
|
||||
"update",&window::update,
|
||||
"set_title",&window::set_title
|
||||
);
|
||||
}
|
||||
void pw::window::set_size(int w,int 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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#ifndef PW_WINDOW_HPP
|
||||
#define PW_WINDOW_HPP
|
||||
|
||||
#include "glad/glad.h"
|
||||
#include "GLFW/glfw3.h"
|
||||
|
||||
#include "sol.hpp"
|
||||
|
||||
namespace pw {
|
||||
|
@ -23,6 +25,7 @@ public:
|
|||
|
||||
|
||||
static void load(sol::table &ns);
|
||||
void set_size(int w, int h);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue