add support for GLFW3
This commit is contained in:
parent
d9acf89784
commit
be45bef9f1
8 changed files with 6241 additions and 3 deletions
|
@ -2976,6 +2976,363 @@ def WindowShouldClose() -> bool:
|
|||
def Wrap(value: float,min_1: float,max_2: float,) -> float:
|
||||
""""""
|
||||
...
|
||||
def glfwCreateCursor(image: Any,xhot: int,yhot: int,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwCreateStandardCursor(shape: int,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwCreateWindow(width: int,height: int,title: str,monitor: Any,share: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwDefaultWindowHints() -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwDestroyCursor(cursor: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwDestroyWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwExtensionSupported(extension: str,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwFocusWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetClipboardString(window: Any,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetCurrentContext() -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetCursorPos(window: Any,xpos: Any,ypos: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetError(description: str,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetFramebufferSize(window: Any,width: Any,height: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetGamepadName(jid: int,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetGamepadState(jid: int,state: Any,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetGammaRamp(monitor: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetInputMode(window: Any,mode: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetJoystickAxes(jid: int,count: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetJoystickButtons(jid: int,count: Any,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetJoystickGUID(jid: int,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetJoystickHats(jid: int,count: Any,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetJoystickName(jid: int,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetJoystickUserPointer(jid: int,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetKey(window: Any,key: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetKeyName(key: int,scancode: int,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetKeyScancode(key: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitorContentScale(monitor: Any,xscale: Any,yscale: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitorName(monitor: Any,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitorPhysicalSize(monitor: Any,widthMM: Any,heightMM: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitorPos(monitor: Any,xpos: Any,ypos: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitorUserPointer(monitor: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitorWorkarea(monitor: Any,xpos: Any,ypos: Any,width: Any,height: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMonitors(count: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetMouseButton(window: Any,button: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetPlatform() -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetPrimaryMonitor() -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetProcAddress(procname: str,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetRequiredInstanceExtensions(count: Any,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetTime() -> float:
|
||||
""""""
|
||||
...
|
||||
def glfwGetTimerFrequency() -> uint64_t:
|
||||
""""""
|
||||
...
|
||||
def glfwGetTimerValue() -> uint64_t:
|
||||
""""""
|
||||
...
|
||||
def glfwGetVersion(major: Any,minor: Any,rev: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetVersionString() -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwGetVideoMode(monitor: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetVideoModes(monitor: Any,count: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowAttrib(window: Any,attrib: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowContentScale(window: Any,xscale: Any,yscale: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowFrameSize(window: Any,left: Any,top: Any,right: Any,bottom: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowMonitor(window: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowOpacity(window: Any,) -> float:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowPos(window: Any,xpos: Any,ypos: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowSize(window: Any,width: Any,height: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwGetWindowUserPointer(window: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwHideWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwIconifyWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwInit() -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwInitAllocator(allocator: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwInitHint(hint: int,value: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwJoystickIsGamepad(jid: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwJoystickPresent(jid: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwMakeContextCurrent(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwMaximizeWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwPlatformSupported(platform: int,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwPollEvents() -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwPostEmptyEvent() -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwRawMouseMotionSupported() -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwRequestWindowAttention(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwRestoreWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetCharCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetCharModsCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetClipboardString(window: Any,string: str,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetCursor(window: Any,cursor: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetCursorEnterCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetCursorPos(window: Any,xpos: float,ypos: float,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetCursorPosCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetDropCallback(window: Any,callback: str,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwSetErrorCallback(callback: str,) -> str:
|
||||
""""""
|
||||
...
|
||||
def glfwSetFramebufferSizeCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetGamma(monitor: Any,gamma: float,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetGammaRamp(monitor: Any,ramp: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetInputMode(window: Any,mode: int,value: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetJoystickCallback(callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetJoystickUserPointer(jid: int,pointer: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetKeyCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetMonitorCallback(callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetMonitorUserPointer(monitor: Any,pointer: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetMouseButtonCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetScrollCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetTime(time: float,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowAspectRatio(window: Any,numer: int,denom: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowAttrib(window: Any,attrib: int,value: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowCloseCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowContentScaleCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowFocusCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowIcon(window: Any,count: int,images: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowIconifyCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowMaximizeCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowMonitor(window: Any,monitor: Any,xpos: int,ypos: int,width: int,height: int,refreshRate: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowOpacity(window: Any,opacity: float,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowPos(window: Any,xpos: int,ypos: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowPosCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowRefreshCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowShouldClose(window: Any,value: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowSize(window: Any,width: int,height: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowSizeCallback(window: Any,callback: Any,) -> Any:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowSizeLimits(window: Any,minwidth: int,minheight: int,maxwidth: int,maxheight: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowTitle(window: Any,title: str,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSetWindowUserPointer(window: Any,pointer: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwShowWindow(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSwapBuffers(window: Any,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwSwapInterval(interval: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwTerminate() -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwUpdateGamepadMappings(string: str,) -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwVulkanSupported() -> int:
|
||||
""""""
|
||||
...
|
||||
def glfwWaitEvents() -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwWaitEventsTimeout(timeout: float,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwWindowHint(hint: int,value: int,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwWindowHintString(hint: int,value: str,) -> None:
|
||||
""""""
|
||||
...
|
||||
def glfwWindowShouldClose(window: Any,) -> int:
|
||||
""""""
|
||||
...
|
||||
def rlActiveDrawBuffers(count: int,) -> None:
|
||||
"""Activate multiple draw color buffers"""
|
||||
...
|
||||
|
@ -3434,6 +3791,14 @@ CubemapLayout: int
|
|||
FilePathList: struct
|
||||
Font: struct
|
||||
FontType: int
|
||||
GLFWallocator: struct
|
||||
GLFWcursor: struct
|
||||
GLFWgamepadstate: struct
|
||||
GLFWgammaramp: struct
|
||||
GLFWimage: struct
|
||||
GLFWmonitor: struct
|
||||
GLFWvidmode: struct
|
||||
GLFWwindow: struct
|
||||
GamepadAxis: int
|
||||
GamepadButton: int
|
||||
Gesture: int
|
||||
|
|
|
@ -125,6 +125,12 @@ def build_unix():
|
|||
#include "raymath.h"
|
||||
"""
|
||||
|
||||
glfw3_h = get_the_include_path() + "/GLFW/glfw3.h"
|
||||
if check_header_exists(glfw3_h):
|
||||
ffi_includes += """
|
||||
#include "GLFW/glfw3.h"
|
||||
"""
|
||||
|
||||
raygui_h = get_the_include_path() + "/raygui.h"
|
||||
if check_header_exists(raygui_h):
|
||||
ffi_includes += """
|
||||
|
@ -141,6 +147,7 @@ def build_unix():
|
|||
"""
|
||||
|
||||
ffibuilder.cdef(pre_process_header(raylib_h))
|
||||
ffibuilder.cdef(pre_process_header(glfw3_h))
|
||||
ffibuilder.cdef(pre_process_header(rlgl_h))
|
||||
ffibuilder.cdef(pre_process_header(raymath_h, True))
|
||||
|
||||
|
@ -158,7 +165,7 @@ def build_unix():
|
|||
else: #platform.system() == "Linux":
|
||||
print("BUILDING FOR LINUX")
|
||||
extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL',
|
||||
'-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic']
|
||||
'-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic']
|
||||
libraries = ['GL', 'm', 'pthread', 'dl', 'rt', 'X11', 'atomic']
|
||||
|
||||
ffibuilder.set_source("raylib._raylib_cffi",
|
||||
|
@ -171,6 +178,7 @@ def build_unix():
|
|||
def build_windows():
|
||||
print("BUILDING FOR WINDOWS")
|
||||
ffibuilder.cdef(open("raylib/raylib.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/glfw3.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/rlgl.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/raygui.h.modified").read())
|
||||
ffibuilder.cdef(open("raylib/physac.h.modified").read())
|
||||
|
@ -179,6 +187,7 @@ def build_windows():
|
|||
#include "raylib.h"
|
||||
#include "rlgl.h"
|
||||
#include "raymath.h"
|
||||
#include "GLFW/glfw3.h"
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#define RAYGUI_SUPPORT_RICONS
|
||||
#include "raygui.h"
|
||||
|
@ -188,6 +197,7 @@ def build_windows():
|
|||
extra_link_args=['/NODEFAULTLIB:MSVCRTD'],
|
||||
libraries=['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm'],
|
||||
include_dirs=['D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src',
|
||||
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src\\external\\glfw\\include',
|
||||
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raygui\\src',
|
||||
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\physac\\src'],
|
||||
)
|
||||
|
|
5502
raylib/glfw3.h.modified
Normal file
5502
raylib/glfw3.h.modified
Normal file
File diff suppressed because it is too large
Load diff
Reference in a new issue