Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make glfw backend optional #5

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if defined(CIMGUI_GO_USE_GLFW)
#define GL_SILENCE_DEPRECATION
#define CIMGUI_USE_GLFW
#define CIMGUI_USE_OPENGL3
Expand Down Expand Up @@ -276,3 +277,5 @@ void igDeleteTexture(ImTextureID id) {
void igGLFWWindow_GetDisplaySize(GLFWwindow *window, int *width, int *height) {
glfwGetWindowSize(window, width, height);
}

#endif
4 changes: 4 additions & 0 deletions backend.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cimgui_glfw
// +build cimgui_glfw

package cimgui

// #cgo amd64,linux LDFLAGS: ${SRCDIR}/lib/linux/x64/libglfw3.a -ldl -lGL -lX11
Expand All @@ -7,6 +10,7 @@ package cimgui
// #cgo arm64,darwin LDFLAGS: ${SRCDIR}/lib/macos/arm64/libglfw3.a
// #cgo !gles2,darwin LDFLAGS: -framework OpenGL
// #cgo gles2,darwin LDFLAGS: -lGLESv2
// #cgo CPPFLAGS: -DCIMGUI_GO_USE_GLFW
// extern void glfwWindowLoopCallback();
// extern void glfwBeforeRender();
// extern void glfwAfterRender();
Expand Down
3 changes: 3 additions & 0 deletions texture.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cimgui_glfw
// +build cimgui_glfw

package cimgui

import (
Expand Down