dl
dl_wrap_glfw.h
浏览该文件的文档.
1
12#pragma once
13
14#if (DL_PLATFORM == DL_PLATFORM_ANDROID)
15#include <android/native_window_jni.h>
16#endif
17
18namespace dl
19{
21{
22public:
23 ANativeWindow* _window;
25 _window{nullptr}
26 {}
27};
28
30{
31
32};
33
34inline bool glfwInit() { return true; }
35
36inline bool glfwWindowShouldClose(GLFWwindow* window) { return false; }
37
38inline void glfwGetFramebufferSize(GLFWwindow* window, int* w, int* h)
39{
40 *w = 800;
41 *h = 600;
42}
43
44inline const char** glfwGetRequiredInstanceExtensions(uint32_t* count)
45{
46 static const char* ret[] = {
47 "VK_KHR_surface",
48 "VK_KHR_android_surface"
49 };
50 *count = 2;
51 return ret;
52}
53
54inline void glfwWaitEvents(){}
55inline void glfwPollEvents(){}
56inline void glfwDestroyWindow(GLFWwindow* window){}
57inline void glfwTerminate(){}
58inline void glfwSetCursorPos(GLFWwindow* window, int x, int y){}
59
60inline void glfwGetWindowSize(GLFWwindow* window, int* w, int* h){}
61inline void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* x, int* y, int* w, int* h){}
62inline void glfwGetWindowSize(GLFWwindow* window, int x, int y){}
63inline void glfwSetWindowPos(GLFWwindow* window, int x, int y){}
64
65}
ANativeWindow * _window
const char ** glfwGetRequiredInstanceExtensions(uint32_t *count)
void glfwSetWindowPos(GLFWwindow *window, int x, int y)
void glfwWaitEvents()
void glfwGetFramebufferSize(GLFWwindow *window, int *w, int *h)
void glfwPollEvents()
void glfwGetMonitorWorkarea(GLFWmonitor *monitor, int *x, int *y, int *w, int *h)
bool glfwWindowShouldClose(GLFWwindow *window)
void glfwGetWindowSize(GLFWwindow *window, int *w, int *h)
bool glfwInit()
void glfwSetCursorPos(GLFWwindow *window, int x, int y)
void glfwTerminate()
void glfwDestroyWindow(GLFWwindow *window)