Compare commits
2 commits
dd83815498
...
8fe8fbb493
| Author | SHA1 | Date | |
|---|---|---|---|
| 8fe8fbb493 | |||
| 9842fee816 |
1 changed files with 5 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
#include "SDL3/SDL_hints.h"
|
||||||
#include "SDL3/SDL_init.h"
|
#include "SDL3/SDL_init.h"
|
||||||
#include "arena_allocator.h"
|
#include "arena_allocator.h"
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
|
@ -6,6 +7,9 @@
|
||||||
#include <SDL3/SDL_opengl.h>
|
#include <SDL3/SDL_opengl.h>
|
||||||
|
|
||||||
wn_window *wn_window_init(Arena *arena) {
|
wn_window *wn_window_init(Arena *arena) {
|
||||||
|
// Try to use X11 till I fix glew may require xwayland
|
||||||
|
SDL_SetHint(SDL_HINT_VIDEO_DRIVER, "x11");
|
||||||
|
|
||||||
wn_window *window = arena_alloc(arena, sizeof(wn_window));
|
wn_window *window = arena_alloc(arena, sizeof(wn_window));
|
||||||
*window = (wn_window){0};
|
*window = (wn_window){0};
|
||||||
|
|
||||||
|
|
@ -39,6 +43,7 @@ wn_window *wn_window_init(Arena *arena) {
|
||||||
if (glewError != GLEW_OK) {
|
if (glewError != GLEW_OK) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error initializing GLEW! %s",
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error initializing GLEW! %s",
|
||||||
glewGetErrorString(glewError));
|
glewGetErrorString(glewError));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SDL_GL_MakeCurrent(window->window, window->glcontext)) {
|
if (!SDL_GL_MakeCurrent(window->window, window->glcontext)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue