mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
Fix ui on mac (#1044)
* remove line_shader dead code
* fix glfwCreateWindow
* don't assert on ipc socket failure
* window now appears on mac
old-commit-hash: 811b3b7a9a
This commit is contained in:
@@ -25,9 +25,16 @@ FramebufferState* framebuffer_init(
|
||||
int *out_w, int *out_h) {
|
||||
glfwInit();
|
||||
|
||||
#ifndef __APPLE__
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
#else
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
#endif
|
||||
glfwWindowHint(GLFW_RESIZABLE, 0);
|
||||
GLFWwindow* window;
|
||||
window = glfwCreateWindow(1920, 1080, "ui", NULL, NULL);
|
||||
@@ -39,7 +46,7 @@ FramebufferState* framebuffer_init(
|
||||
glfwSwapInterval(0);
|
||||
|
||||
// clear screen
|
||||
glClearColor(0.2f, 0.2f, 0.2f, 1.0f );
|
||||
glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
framebuffer_swap((FramebufferState*)window);
|
||||
|
||||
@@ -54,6 +61,7 @@ void framebuffer_set_power(FramebufferState *s, int mode) {
|
||||
|
||||
void framebuffer_swap(FramebufferState *s) {
|
||||
glfwSwapBuffers((GLFWwindow*)s);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
void touch_init(TouchState *s) {
|
||||
|
||||
Reference in New Issue
Block a user