QOL docs, colors, version number, example imports

This commit is contained in:
richard 2021-10-04 15:56:29 +01:00
parent 9e17046408
commit 50c2fb12e2
13 changed files with 102 additions and 66 deletions

View file

@ -18,5 +18,7 @@ from raylib.colors import *
import cffi
import sys
from raylib.pyray import PyRay
from .version import __version__
print("RAYLIB STATIC "+__version__+" LOADED", file=sys.stderr)
print("RAYLIB STATIC LOADED", file=sys.stderr)

View file

@ -15,6 +15,8 @@
# Assumes raylib, GL, etc are all already installed as system libraries. We dont distribute them.
# Raylib must be installed and compiled with: cmake -DWITH_PIC=ON -DSHARED=ON -DSTATIC=ON ..
# We use /usr/local/lib/libraylib.a to ensure we link to static version
from cffi import FFI
import os
import platform
@ -27,7 +29,7 @@ def build_linux():
ffibuilder.cdef(open("raylib/raylib_modified.h").read().replace('RLAPI ', ''))
ffibuilder.set_source("raylib._raylib_cffi",
"""
#include "../../raylib/raylib.h"
#include "raylib.h"
""",
extra_link_args=['/usr/local/lib/libraylib.a','-lm', '-lpthread', '-lGLU', '-lGL', '-lrt', '-lm', '-ldl', '-lX11', '-lpthread'],
libraries=['GL','m','pthread', 'dl', 'rt', 'X11']
@ -55,7 +57,7 @@ def build_mac():
"""
#include "../../raylib/raylib.h" // the C header of the library, supplied by us here
""",
extra_link_args=['-lraylib', '-framework', 'OpenGL', '-framework', 'Cocoa', '-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework', 'CoreVideo'],
extra_link_args=['/usr/local/lib/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa', '-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework', 'CoreVideo'],
)
if __name__ == "__main__":

View file

@ -21,6 +21,33 @@ class PyRay:
def pointer(self, struct):
return ffi.addressof(struct)
LIGHTGRAY =( 200, 200, 200, 255 )
GRAY =( 130, 130, 130, 255 )
DARKGRAY =( 80, 80, 80, 255 )
YELLOW =( 253, 249, 0, 255 )
GOLD =( 255, 203, 0, 255 )
ORANGE =( 255, 161, 0, 255 )
PINK =( 255, 109, 194, 255 )
RED =( 230, 41, 55, 255 )
MAROON =( 190, 33, 55, 255 )
GREEN =( 0, 228, 48, 255 )
LIME =( 0, 158, 47, 255 )
DARKGREEN =( 0, 117, 44, 255 )
SKYBLUE =( 102, 191, 255, 255 )
BLUE =( 0, 121, 241, 255 )
DARKBLUE =( 0, 82, 172, 255 )
PURPLE =( 200, 122, 255, 255 )
VIOLET =( 135, 60, 190, 255 )
DARKPURPLE =( 112, 31, 126, 255 )
BEIGE =( 211, 176, 131, 255 )
BROWN =( 127, 106, 79, 255 )
DARKBROWN =( 76, 63, 47, 255 )
WHITE =( 255, 255, 255, 255 )
BLACK =( 0, 0, 0, 255 )
BLANK =( 0, 0, 0, 0 )
MAGENTA =( 255, 0, 255, 255 )
RAYWHITE =( 245, 245, 245, 255 )
def makefunc(a):
#print("makefunc ",a, ffi.typeof(a).args)

1
raylib/version.py Symbolic link
View file

@ -0,0 +1 @@
../version.py