1. Alberto Torres
  2. pygamekit

Source

pygamekit / prerequisites.pxd



# C defines that are too small or don't fit anywhere else

from libcpp cimport bool

cdef extern from "stdlib.h":
     void *memcpy(void *dst, void *src, long n)

cdef extern from "time.h":
    int usleep(int usec)
     
ctypedef float Real

(       OGRE_RS_GL,
        OGRE_RS_GLES,
        OGRE_RS_D3D9,
        OGRE_RS_D3D10,
        OGRE_RS_D3D11,
        OGRE_RS_UNKNOWN) = range(6)

cdef enum:
    TRANSFORM_LOCAL,
    TRANSFORM_PARENT,
    TRANSFORM_WORLD
    
cdef extern from "gkCommon.h":
    enum:
        GK_PLATFORM_WIN32
        GK_PLATFORM_APPLE
        GK_PLATFORM_APPLE_IOS
        GK_PLATFORM_LINUX
        GK_PLATFORM_ANDROID
        GK_PLATFORM

    cppclass gkClock "Ogre::Timer":
        void reset()
        unsigned long int getMilliseconds()
        unsigned long int getMicroseconds()
        
cdef extern from "string": 
    cppclass std_string "std::string": 
        std_string()
        std_string(char* str)
        char* c_str()
        #std_string& assign ( std_string& str )
        #std_string& assign ( std_string& str, size_t pos, size_t n )
        #std_string& assign ( char* s, size_t n )
        std_string& assign ( char* s )
        #std_string& assign ( size_t n, char c )
         
    cdef std_string to_stdstring "std::string"(char*)

cdef extern from *:
    ctypedef char* const_char_ptr "const char*"
    ctypedef std_string const_std_string "const std_string"

    cppclass gkColor:
        gkColor(float r, float g, float b, float a)
        gkColor(float r, float g, float b)
        
    ctypedef gkColor Ogre_ColourValue "Ogre::ColourValue"
        
    cdef cppclass gkHashedString:
        gkHashedString(const_std_string&)
        const_std_string &str()
        
    ctypedef gkHashedString const_gkHashedString "const gkHashedString"
    
    cdef cppclass Ogre_StringVector "Ogre::StringVector":
        void push_back(std_string)
#TODO: with cython>0.15.1, replace the lines above with the lines below
#from libcpp.vector cimport vector
#ctypedef vector[std_string] Ogre_StringVector "Ogre::StringVector"

ctypedef  int OgreRenderSystem