Changeset 63939 in vbox for trunk/src/VBox/Additions/common/crOpenGL/feedback
- Timestamp:
- Sep 22, 2016 7:58:05 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110825
- Location:
- trunk/src/VBox/Additions/common/crOpenGL/feedback
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback.py
r17269 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - generated by feedback.py */ 15 16 #include <stdio.h> … … 20 21 #include "cr_glstate.h" 21 22 22 """ 23 """) 23 24 24 25 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 28 29 params = apiutil.Parameters(func_name) 29 30 if apiutil.FindSpecial( "feedback", func_name ): 30 print 'static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params))31 print '{'32 print '\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params))33 print '}'34 35 36 37 print 31 print('static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )) 32 print('{') 33 print('\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )) 34 print('}') 35 36 37 38 print(""" 38 39 #define CHANGE( name, func ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) func) ) 39 40 #define CHANGESWAP( name, swapfunc, regfunc ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) (feedback_spu.swap ? swapfunc: regfunc )) ) … … 41 42 static void __loadFeedbackAPI( void ) 42 43 { 43 """ 44 """) 44 45 for func_name in keys: 45 46 return_type = apiutil.ReturnType(func_name) 46 47 params = apiutil.Parameters(func_name) 47 48 if apiutil.FindSpecial( "feedback", func_name ): 48 print '\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name)49 print 49 print('\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name )) 50 print(""" 50 51 } 51 52 52 53 static void __loadSelectAPI( void ) 53 54 { 54 """ 55 """) 55 56 for func_name in keys: 56 57 if apiutil.FindSpecial( "select", func_name ): 57 print '\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name)58 print('\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name )) 58 59 elif apiutil.FindSpecial( "feedback", func_name ): 59 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name)60 print 60 print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )) 61 print(""" 61 62 } 62 63 63 64 static void __loadRenderAPI( void ) 64 65 { 65 """ 66 """) 66 67 67 68 for func_name in keys: 68 69 return_type = apiutil.ReturnType(func_name) 69 70 if apiutil.FindSpecial( "feedback", func_name ) or apiutil.FindSpecial( "select", func_name ): 70 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name)71 print 72 } 73 """ 74 75 print 71 print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )) 72 print(""" 73 } 74 """) 75 76 print(""" 76 77 static GLint FEEDBACKSPU_APIENTRY feedbackspu_RenderMode ( GLenum mode ) 77 78 { … … 211 212 212 213 SPUNamedFunctionTable _cr_feedback_table[] = { 213 """ 214 """) 214 215 215 216 for func_name in keys: 216 217 if apiutil.FindSpecial( "feedback_state", func_name ): 217 print '\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name)218 print 218 print('\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name )) 219 print(""" 219 220 { "GetBooleanv", (SPUGenericFunction) feedbackspu_GetBooleanv }, 220 221 { "GetDoublev", (SPUGenericFunction) feedbackspu_GetDoublev }, … … 267 268 { NULL, NULL } 268 269 }; 269 """ 270 """) -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_funcs.py
r17269 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY feedback_funcs.py SCRIPT */ 15 16 #ifndef CR_STATE_FEEDBACK_FUNCS_H … … 24 25 #endif 25 26 26 #define STATE_UNUSED(x) ((void)x)""" 27 #define STATE_UNUSED(x) ((void)x)""") 27 28 28 29 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 31 32 return_type = apiutil.ReturnType(func_name) 32 33 params = apiutil.Parameters(func_name) 33 print '%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))34 print('%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 34 35 35 36 for func_name in apiutil.AllSpecials( "select" ): 36 37 return_type = apiutil.ReturnType(func_name) 37 38 params = apiutil.Parameters(func_name) 38 print '%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))39 print '\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */'39 print('%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 40 print('\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */') -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py
r42499 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 #include "cr_server.h" 15 16 #include "feedbackspu.h" 16 17 #include "feedbackspu_proto.h" 17 """ 18 """) 18 19 custom = ["CreateContext", "VBoxCreateContext", "MakeCurrent", "DestroyContext"] 19 20 … … 26 27 return_type = apiutil.ReturnType(func_name) 27 28 params = apiutil.Parameters(func_name) 28 print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))29 print '{'30 print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))31 print ''32 print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))33 print '}'29 print('%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 30 print('{') 31 print('\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))) 32 print('') 33 print('\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))) 34 print('}') -
trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_proto.py
r17269 r63939 4 4 # See the file LICENSE.txt for information on redistributing this software. 5 5 6 from __future__ import print_function 6 7 import sys 7 8 … … 11 12 apiutil.CopyrightC() 12 13 13 print 14 print(""" 14 15 /* DO NOT EDIT - generated by feedback.py */ 15 16 … … 19 20 #include "feedbackspu.h" 20 21 21 """ 22 """) 22 23 23 24 keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") … … 27 28 return_type = apiutil.ReturnType(func_name) 28 29 params = apiutil.Parameters(func_name) 29 print 'extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))30 print('extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))) 30 31 31 32 32 print 33 print(""" 33 34 #endif 34 """ 35 """)
Note:
See TracChangeset
for help on using the changeset viewer.