mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 05:36:35 +00:00
gears-gles2 example added to test vivante backend.
small update in vivante_window.c
This commit is contained in:
parent
ea497286aa
commit
a96436ccf1
@ -38,6 +38,7 @@ set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
|
||||
|
||||
add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD_GL})
|
||||
add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD_GL})
|
||||
add_executable(gears-gles2 WIN32 MACOSX_BUNDLE gears-gles2.c ${ICON} ${GLAD_GL})
|
||||
add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL})
|
||||
add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL})
|
||||
add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL})
|
||||
@ -51,7 +52,7 @@ if (RT_LIBRARY)
|
||||
target_link_libraries(particles "${RT_LIBRARY}")
|
||||
endif()
|
||||
|
||||
set(WINDOWS_BINARIES boing gears heightmap particles sharing simple splitview wave)
|
||||
set(WINDOWS_BINARIES boing gears gears-gles2 heightmap particles sharing simple splitview wave)
|
||||
set(CONSOLE_BINARIES offscreen)
|
||||
|
||||
set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
|
||||
@ -66,6 +67,7 @@ endif()
|
||||
if (APPLE)
|
||||
set_target_properties(boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
|
||||
set_target_properties(gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
|
||||
set_target_properties(gears-gles2 PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "GearsGLES2")
|
||||
set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
|
||||
set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
|
||||
set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing")
|
||||
|
1189
examples/gears-gles2.c
Normal file
1189
examples/gears-gles2.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -27,16 +27,28 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
static int queryWindowGeometry(_GLFWwindow* window )
|
||||
{
|
||||
if (!window->vivante.native_window)
|
||||
return GLFW_FALSE;
|
||||
|
||||
fbGetWindowGeometry(window->vivante.native_window
|
||||
, &window->vivante.xpos, &window->vivante.ypos
|
||||
, &window->vivante.width, &window->vivante.height);
|
||||
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
static int createNativeWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig)
|
||||
{
|
||||
window->vivante.native_window = fbCreateWindow( _GLFW_EGL_NATIVE_DISPLAY, 0, 0, wndconfig->width, wndconfig->height );
|
||||
window->vivante.native_window = fbCreateWindow(_GLFW_EGL_NATIVE_DISPLAY, 0, 0, 0, 0);//, wndconfig->width, wndconfig->height);
|
||||
if (!window->vivante.native_window)
|
||||
return GLFW_FALSE;
|
||||
|
||||
window->vivante.width = wndconfig->width;
|
||||
window->vivante.height = wndconfig->height;
|
||||
|
||||
if (!queryWindowGeometry(window))
|
||||
return GLFW_FALSE;
|
||||
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
@ -119,8 +131,6 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
||||
|
||||
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
{
|
||||
window->vivante.width = width;
|
||||
window->vivante.height = height;
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,
|
||||
|
Loading…
Reference in New Issue
Block a user