Cleanup
This commit is contained in:
@@ -1202,7 +1202,7 @@ void android_main(struct android_app *application) {
|
||||
(*activity->vm)->DetachCurrentThread(activity->vm);
|
||||
}
|
||||
|
||||
void kinc_init(const char *name, int width, int height, struct kinc_window_options *win, struct kinc_framebuffer_options *frame) {
|
||||
void kinc_init(const char *name, int width, int height, struct kinc_window_options *win) {
|
||||
kinc_mutex_init(&unicode_mutex);
|
||||
|
||||
kinc_window_options_t default_win;
|
||||
@@ -1213,14 +1213,8 @@ void kinc_init(const char *name, int width, int height, struct kinc_window_optio
|
||||
win->width = width;
|
||||
win->height = height;
|
||||
|
||||
kinc_framebuffer_options_t default_frame;
|
||||
if (frame == NULL) {
|
||||
kinc_framebuffer_options_set_defaults(&default_frame);
|
||||
frame = &default_frame;
|
||||
}
|
||||
|
||||
kinc_g5_internal_init();
|
||||
kinc_g4_internal_init_window(frame->depth_bits, true);
|
||||
kinc_g4_internal_init_window(win->depth_bits, true);
|
||||
|
||||
kinc_internal_gamepad_trigger_connect(0);
|
||||
}
|
||||
@@ -1350,9 +1344,7 @@ void kinc_window_hide() {}
|
||||
|
||||
void kinc_window_set_title(const char *title) {}
|
||||
|
||||
void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
|
||||
}
|
||||
void kinc_window_create(kinc_window_options_t *win) {}
|
||||
|
||||
void kinc_window_set_resize_callback(void (*callback)(int x, int y, void *data), void *data) {
|
||||
resizeCallback = callback;
|
||||
|
||||
@@ -614,19 +614,14 @@ void KoreUpdateKeyboard(void) {
|
||||
|
||||
void kinc_internal_shutdown(void) {}
|
||||
|
||||
void kinc_init(const char *name, int width, int height, struct kinc_window_options *win, struct kinc_framebuffer_options *frame) {
|
||||
void kinc_init(const char *name, int width, int height, struct kinc_window_options *win) {
|
||||
kinc_window_options_t defaultWin;
|
||||
if (win == NULL) {
|
||||
kinc_window_options_set_defaults(&defaultWin);
|
||||
win = &defaultWin;
|
||||
}
|
||||
kinc_framebuffer_options_t defaultFrame;
|
||||
if (frame == NULL) {
|
||||
kinc_framebuffer_options_set_defaults(&defaultFrame);
|
||||
frame = &defaultFrame;
|
||||
}
|
||||
kinc_g5_internal_init();
|
||||
kinc_g4_internal_init_window(frame->depth_bits, true);
|
||||
kinc_g4_internal_init_window(win->depth_bits, true);
|
||||
}
|
||||
|
||||
void endGL(void);
|
||||
@@ -732,9 +727,7 @@ void kinc_window_hide() {}
|
||||
|
||||
void kinc_window_set_title(const char *title) {}
|
||||
|
||||
void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
|
||||
}
|
||||
void kinc_window_create(kinc_window_options_t *win) {}
|
||||
|
||||
void kinc_window_set_resize_callback(void (*callback)(int x, int y, void *data), void *data) {
|
||||
resizeCallback = callback;
|
||||
|
||||
@@ -373,7 +373,7 @@ void kinc_window_set_title(const char *_title) {
|
||||
xlib.XFlush(x11_ctx.display);
|
||||
}
|
||||
|
||||
void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_window_create(kinc_window_options_t *win) {
|
||||
struct kinc_x11_window *window = &x11_ctx.windows[0];
|
||||
window->width = win->width;
|
||||
window->height = win->height;
|
||||
@@ -424,7 +424,7 @@ void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *
|
||||
xlib.XSelectExtensionEvent(x11_ctx.display, window->window, &x11_ctx.eraser.motionClass, 1);
|
||||
}
|
||||
|
||||
kinc_g4_internal_init_window(frame->depth_bits, frame->vertical_sync);
|
||||
kinc_g4_internal_init_window(win->depth_bits, win->vsync);
|
||||
}
|
||||
|
||||
static struct {
|
||||
@@ -1434,7 +1434,7 @@ kinc_ticks_t kinc_timestamp(void) {
|
||||
return (kinc_ticks_t)now.tv_sec * 1000000 + (kinc_ticks_t)now.tv_usec;
|
||||
}
|
||||
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win) {
|
||||
kinc_linux_initHIDGamepads();
|
||||
|
||||
gettimeofday(&start, NULL);
|
||||
@@ -1450,18 +1450,13 @@ void kinc_init(const char *name, int width, int height, kinc_window_options_t *w
|
||||
kinc_window_options_set_defaults(&defaultWin);
|
||||
win = &defaultWin;
|
||||
}
|
||||
kinc_framebuffer_options_t defaultFrame;
|
||||
if (frame == NULL) {
|
||||
kinc_framebuffer_options_set_defaults(&defaultFrame);
|
||||
frame = &defaultFrame;
|
||||
}
|
||||
win->width = width;
|
||||
win->height = height;
|
||||
if (win->title == NULL) {
|
||||
win->title = name;
|
||||
}
|
||||
|
||||
kinc_window_create(win, frame);
|
||||
kinc_window_create(win);
|
||||
}
|
||||
|
||||
void kinc_internal_shutdown() {
|
||||
|
||||
@@ -1139,10 +1139,10 @@ static void createWindow(kinc_window_options_t *options) {
|
||||
int width = options->width / [[NSScreen mainScreen] backingScaleFactor];
|
||||
int height = options->height / [[NSScreen mainScreen] backingScaleFactor];
|
||||
int styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable;
|
||||
if ((options->window_features & KINC_WINDOW_FEATURE_RESIZEABLE) || (options->window_features & KINC_WINDOW_FEATURE_MAXIMIZABLE)) {
|
||||
if ((options->features & KINC_WINDOW_FEATURE_RESIZEABLE) || (options->features & KINC_WINDOW_FEATURE_MAXIMIZABLE)) {
|
||||
styleMask |= NSWindowStyleMaskResizable;
|
||||
}
|
||||
if (options->window_features & KINC_WINDOW_FEATURE_MINIMIZABLE) {
|
||||
if (options->features & KINC_WINDOW_FEATURE_MINIMIZABLE) {
|
||||
styleMask |= NSWindowStyleMaskMiniaturizable;
|
||||
}
|
||||
|
||||
@@ -1205,7 +1205,7 @@ static void addMenubar(void) {
|
||||
[NSApp setMainMenu:menubar];
|
||||
}
|
||||
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win) {
|
||||
@autoreleasepool {
|
||||
myapp = [KincApplication sharedApplication];
|
||||
[myapp finishLaunching];
|
||||
@@ -1223,12 +1223,6 @@ void kinc_init(const char *name, int width, int height, kinc_window_options_t *w
|
||||
win = &defaultWindowOptions;
|
||||
}
|
||||
|
||||
kinc_framebuffer_options_t defaultFramebufferOptions;
|
||||
if (frame == NULL) {
|
||||
kinc_framebuffer_options_set_defaults(&defaultFramebufferOptions);
|
||||
frame = &defaultFramebufferOptions;
|
||||
}
|
||||
|
||||
win->width = width;
|
||||
win->height = height;
|
||||
if (win->title == NULL) {
|
||||
@@ -1237,7 +1231,7 @@ void kinc_init(const char *name, int width, int height, kinc_window_options_t *w
|
||||
|
||||
createWindow(win);
|
||||
kinc_g5_internal_init();
|
||||
kinc_g4_internal_init_window(frame->depth_bits, true);
|
||||
kinc_g4_internal_init_window(win->depth_bits, true);
|
||||
}
|
||||
|
||||
int kinc_window_width() {
|
||||
@@ -1374,7 +1368,7 @@ void kinc_window_hide() {}
|
||||
|
||||
void kinc_window_set_title(const char *title) {}
|
||||
|
||||
void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_window_create(kinc_window_options_t *win) {
|
||||
}
|
||||
|
||||
void kinc_window_set_resize_callback(void (*callback)(int x, int y, void *data), void *data) {
|
||||
|
||||
@@ -73,17 +73,12 @@ __attribute__((import_module("imports"), import_name("js_time"))) int js_time();
|
||||
extern int kinc_internal_window_width;
|
||||
extern int kinc_internal_window_height;
|
||||
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win) {
|
||||
kinc_window_options_t defaultWin;
|
||||
if (win == NULL) {
|
||||
kinc_window_options_set_defaults(&defaultWin);
|
||||
win = &defaultWin;
|
||||
}
|
||||
kinc_framebuffer_options_t defaultFrame;
|
||||
if (frame == NULL) {
|
||||
kinc_framebuffer_options_set_defaults(&defaultFrame);
|
||||
frame = &defaultFrame;
|
||||
}
|
||||
win->width = width;
|
||||
win->height = height;
|
||||
|
||||
@@ -91,7 +86,7 @@ void kinc_init(const char *name, int width, int height, kinc_window_options_t *w
|
||||
kinc_internal_window_height = height;
|
||||
|
||||
kinc_g5_internal_init();
|
||||
kinc_g4_internal_init_window(frame->depth_bits, true);
|
||||
kinc_g4_internal_init_window(win->depth_bits, true);
|
||||
}
|
||||
|
||||
bool kinc_internal_handle_messages() {
|
||||
@@ -211,9 +206,7 @@ void kinc_window_hide() {}
|
||||
// TODO: change browser title.
|
||||
void kinc_window_set_title(const char *title) {}
|
||||
|
||||
void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
|
||||
}
|
||||
void kinc_window_create(kinc_window_options_t *win) {}
|
||||
|
||||
void kinc_window_set_resize_callback(void (*callback)(int x, int y, void *data), void *data) {}
|
||||
|
||||
|
||||
@@ -1671,7 +1671,7 @@ static void init_crash_handler() {
|
||||
}
|
||||
}
|
||||
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_init(const char *name, int width, int height, kinc_window_options_t *win) {
|
||||
init_crash_handler();
|
||||
|
||||
// Pen functions are only in Windows 8 and later, so load them dynamically
|
||||
@@ -2082,20 +2082,14 @@ void kinc_window_set_title(const char *title) {
|
||||
SetWindowTextW(windows[0].handle, buffer);
|
||||
}
|
||||
|
||||
void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *frame) {
|
||||
void kinc_window_create(kinc_window_options_t *win) {
|
||||
kinc_window_options_t defaultWin;
|
||||
kinc_framebuffer_options_t defaultFrame;
|
||||
|
||||
if (win == NULL) {
|
||||
kinc_window_options_set_defaults(&defaultWin);
|
||||
win = &defaultWin;
|
||||
}
|
||||
|
||||
if (frame == NULL) {
|
||||
kinc_framebuffer_options_set_defaults(&defaultFrame);
|
||||
frame = &defaultFrame;
|
||||
}
|
||||
|
||||
if (win->title == NULL) {
|
||||
win->title = "";
|
||||
}
|
||||
@@ -2103,12 +2097,12 @@ void kinc_window_create(kinc_window_options_t *win, kinc_framebuffer_options_t *
|
||||
wchar_t wbuffer[1024];
|
||||
MultiByteToWideChar(CP_UTF8, 0, win->title, -1, wbuffer, 1024);
|
||||
|
||||
createWindow(wbuffer, win->x, win->y, win->width, win->height, frame->color_bits, frame->frequency, win->window_features, win->mode,
|
||||
createWindow(wbuffer, win->x, win->y, win->width, win->height, win->color_bits, win->frequency, win->features, win->mode,
|
||||
win->display_index);
|
||||
|
||||
bool vsync = frame->vertical_sync;
|
||||
bool vsync = win->vsync;
|
||||
|
||||
kinc_g4_internal_init_window(frame->depth_bits, vsync);
|
||||
kinc_g4_internal_init_window(win->depth_bits, vsync);
|
||||
|
||||
if (win->visible) {
|
||||
kinc_window_show();
|
||||
|
||||
Reference in New Issue
Block a user