1. Pierre-Yves David
  2. soya

Commits

Paul Morelle  committed a58d5c3

Enabled virtual=true parameter for linux2 platform

  • Participants
  • Parent commits a015cd1
  • Branches default

Comments (0)

Files changed (3)

File soya/init.pyx

View file
 		renderer.engine_option = renderer.engine_option | WIREFRAME
 		
 cdef void dump_info():
+	cdef char *tmp_gl_version
+	cdef char *tmp_gl_renderer
+	cdef char *tmp_gl_vendor
+
 	tmp_gl_version = <char*> glGetString(GL_VERSION)
 	tmp_gl_renderer = <char*> glGetString(GL_RENDERER)
 	tmp_gl_vendor = <char*> glGetString(GL_VENDOR)
 		import soya._macosx
 		surface = <SDLSurface>soya._macosx.MacOSX_SDLSurface(flags, width, height, bpp)
 		ret = surface.sdl_surface
+	elif "linux2" in sys.platform:
+		import soya._linux2
+		surface = <SDLSurface>soya._linux2.Linux2_SDLSurface(flags, width, height, bpp)
+		ret = surface.sdl_surface
 	else:
 		s = "Virtual rendering is not supported by Soya3D for platform %s"%sys.platform
 		sys.stderr.write(s + '\n')

File soya/sdl.pxd

View file
 	ctypedef struct SDL_Rect:
 		unsigned short      x, y
 		unsigned short      w, h
-		
-	ctypedef struct SDL_Surface:
-		Uint32 flags
-		SDL_PixelFormat *format
-		int w, h
-		Uint16 pitch
-		void *pixels
-		int offset
-		void *hwdata
-		SDL_Rect clip_rect
-		Uint32 unused1
-		Uint32 locked
-		void *map
-		unsigned int format_version
-		int refcount
 
 	ctypedef struct SDL_Joystick
 	ctypedef struct SDL_PixelFormat:
 		unsigned int  colorkey # RGB color key information
 		unsigned char alpha    # Alpha value information (per-surface alpha)
 		
+	ctypedef struct SDL_Surface:
+		Uint32 flags
+		SDL_PixelFormat *format
+		int w, h
+		Uint16 pitch
+		void *pixels
+		int offset
+		void *hwdata
+		SDL_Rect clip_rect
+		Uint32 unused1
+		Uint32 locked
+		void *map
+		unsigned int format_version
+		int refcount
+		
 	ctypedef struct SDL_VideoInfo:
 		unsigned int hw_available # Flag: Can you create hardware surfaces?
 		unsigned int wm_available # Flag: Can you talk to a window manager?

File soya/setup.py

View file
 
 if build_ext_pyrex and build_ext_cython:
     # prefere cython over pyrex
-    build_ext = build_ext_cython 
+    build_ext = build_ext_cython
     if '--pyrex' in sys.argv:
         build_ext = build_ext_pyrex
         sys.argv.remove('--pyrex')
 							extra_compile_args = COMPILE_ARGS,
 							extra_link_args = LINK_ARGS,
 							))
+	elif "linux2" in sys.platform:
+		KARGS["ext_modules"].append(Extension("soya._linux2", ["_linux2.pyx"],
+							include_dirs=INCDIR, library_dirs=LIBDIR,
+							libraries=LIBS, define_macros=DEFINES,
+							extra_compile_args = COMPILE_ARGS,
+							extra_link_args = LINK_ARGS,
+							))
 	
 else:
 	print
 		Extension("soya._soya", SOYA_C_SOURCES,
 							include_dirs=INCDIR, library_dirs=LIBDIR,
 							libraries=LIBS, define_macros=DEFINES,
-							extra_compile_args = COMPILE_ARGS, 
+							extra_compile_args = COMPILE_ARGS,
 							),
 		Extension("soya.opengl",   ["opengl.c"],
 							include_dirs=INCDIR, library_dirs=LIBDIR,
 							libraries=LIBS, define_macros=DEFINES,
-							extra_compile_args = COMPILE_ARGS, 
+							extra_compile_args = COMPILE_ARGS,
 							),
 		Extension("soya.sdlconst", ["sdlconst.c"],
 							include_dirs=INCDIR, library_dirs=LIBDIR,
 							libraries=LIBS, define_macros=DEFINES,
-							extra_compile_args = COMPILE_ARGS, 
+							extra_compile_args = COMPILE_ARGS,
 							)
 		],
 		"cmdclass" : {
 		KARGS["ext_modules"].append(Extension("soya._macosx", ["_macosx.c"],
 							include_dirs=INCDIR, library_dirs=LIBDIR,
 							libraries=LIBS, define_macros=DEFINES,
-							extra_compile_args = COMPILE_ARGS, 
+							extra_compile_args = COMPILE_ARGS,
+							))
+	if "linux2" in sys.platform:
+		KARGS["ext_modules"].append(Extension("soya._linux2", ["_linux2.c"],
+							include_dirs=INCDIR, library_dirs=LIBDIR,
+							libraries=LIBS, define_macros=DEFINES,
+							extra_compile_args = COMPILE_ARGS,
 							))