-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef GUI_DEFAULT_H | ||
#define GUI_DEFAULT_H | ||
|
||
#define NK_INCLUDE_FIXED_TYPES | ||
#define NK_INCLUDE_STANDARD_IO | ||
#define NK_INCLUDE_STANDARD_VARARGS | ||
#define NK_INCLUDE_DEFAULT_ALLOCATOR | ||
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT | ||
#define NK_INCLUDE_FONT_BAKING | ||
#define NK_INCLUDE_DEFAULT_FONT | ||
#define NK_KEYSTATE_BASED_INPUT | ||
#include <nuklear.h> | ||
|
||
#include <structures/concrete/board.h> | ||
|
||
#define WINDOW_WIDTH 500 | ||
#define WINDOW_HEIGHT 560 | ||
|
||
#define MAX_VERTEX_BUFFER 512 * 1024 | ||
#define MAX_ELEMENT_BUFFER 128 * 1024 | ||
|
||
struct nk_solver { | ||
board_s board; | ||
}; | ||
|
||
struct nk_super { | ||
struct nk_context * context; | ||
struct nk_solver solver; | ||
}; | ||
|
||
#endif /* GUI_DEFAULT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef GUI_DRAW_H | ||
#define GUI_DRAW_H | ||
|
||
#define NK_INCLUDE_FIXED_TYPES | ||
#define NK_INCLUDE_STANDARD_IO | ||
#define NK_INCLUDE_STANDARD_VARARGS | ||
#define NK_INCLUDE_DEFAULT_ALLOCATOR | ||
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT | ||
#define NK_INCLUDE_FONT_BAKING | ||
#define NK_INCLUDE_DEFAULT_FONT | ||
#define NK_KEYSTATE_BASED_INPUT | ||
#include <nuklear.h> | ||
#include <nuklear_glfw_gl3.h> | ||
|
||
void draw(struct nk_glfw * glfw); | ||
|
||
#endif /* GUI_DRAW_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef GUI_INPUT_H | ||
#define GUI_INPUT_H | ||
|
||
#define NK_INCLUDE_FIXED_TYPES | ||
#define NK_INCLUDE_STANDARD_IO | ||
#define NK_INCLUDE_STANDARD_VARARGS | ||
#define NK_INCLUDE_DEFAULT_ALLOCATOR | ||
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT | ||
#define NK_INCLUDE_FONT_BAKING | ||
#define NK_INCLUDE_DEFAULT_FONT | ||
#define NK_KEYSTATE_BASED_INPUT | ||
#include <nuklear.h> | ||
#include <nuklear_glfw_gl3.h> | ||
|
||
void input(struct nk_glfw * glfw); | ||
|
||
#endif /* GUI_INPUT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <gui/draw.h> | ||
#include <gui/default.h> | ||
#include <instance/settings.h> | ||
|
||
void draw(struct nk_glfw * glfw) { | ||
glViewport(0, 0, WINDOW_HEIGHT, WINDOW_WIDTH); | ||
glClear(GL_COLOR_BUFFER_BIT); | ||
nk_glfw3_render(glfw, NK_ANTI_ALIASING_ON, MAX_VERTEX_BUFFER, MAX_ELEMENT_BUFFER); | ||
glfwSwapBuffers(glfw->win); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <gui/input.h> | ||
|
||
void input(struct nk_glfw * glfw) { | ||
glfwPollEvents(); | ||
nk_glfw3_new_frame(glfw); | ||
} |