initial commit
This commit is contained in:
commit
be1abc3762
16 changed files with 11692 additions and 0 deletions
32
src/application.c
Normal file
32
src/application.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "application.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "renderer/context.h"
|
||||
|
||||
int init_application(Application* app, const char* name)
|
||||
{
|
||||
assert(app);
|
||||
glfwInit();
|
||||
|
||||
app->window = create_managed_window(name, 800, 800);
|
||||
if (app->window == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int launch_application(Application* app)
|
||||
{
|
||||
while (!glfwWindowShouldClose(app->window))
|
||||
{
|
||||
glfwPollEvents();
|
||||
|
||||
ctx_clear_screen(0.3f, 0.1f, 0.8f, 1.0f);
|
||||
glfwSwapBuffers(app->window);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue