Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOShaderUniformMethodType.h File Reference
+ Include dependency graph for OOShaderUniformMethodType.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef char(* CharReturnMsgSend) (id, SEL)
 
typedef unsigned char(* UnsignedCharReturnMsgSend) (id, SEL)
 
typedef short(* ShortReturnMsgSend) (id, SEL)
 
typedef unsigned short(* UnsignedShortReturnMsgSend) (id, SEL)
 
typedef int(* IntReturnMsgSend) (id, SEL)
 
typedef unsigned int(* UnsignedIntReturnMsgSend) (id, SEL)
 
typedef long(* LongReturnMsgSend) (id, SEL)
 
typedef unsigned long(* UnsignedLongReturnMsgSend) (id, SEL)
 
typedef long long(* LongLongReturnMsgSend) (id, SEL)
 
typedef unsigned long long(* UnsignedLongLongReturnMsgSend) (id, SEL)
 
typedef float(* FloatReturnMsgSend) (id, SEL)
 
typedef double(* DoubleReturnMsgSend) (id, SEL)
 
typedef Vector(* VectorReturnMsgSend) (id, SEL)
 
typedef HPVector(* HPVectorReturnMsgSend) (id, SEL)
 
typedef Quaternion(* QuaternionReturnMsgSend) (id, SEL)
 
typedef OOMatrix(* MatrixReturnMsgSend) (id, SEL)
 
typedef NSPoint(* PointReturnMsgSend) (id, SEL)
 
typedef id(* ObjectReturnMsgSend) (id, SEL)
 

Enumerations

enum  OOShaderUniformType {
  kOOShaderUniformTypeInvalid , kOOShaderUniformTypeChar , kOOShaderUniformTypeUnsignedChar , kOOShaderUniformTypeShort ,
  kOOShaderUniformTypeUnsignedShort , kOOShaderUniformTypeInt , kOOShaderUniformTypeUnsignedInt , kOOShaderUniformTypeLong ,
  kOOShaderUniformTypeUnsignedLong , kOOShaderUniformTypeLongLong , kOOShaderUniformTypeUnsignedLongLong , kOOShaderUniformTypeFloat ,
  kOOShaderUniformTypeDouble , kOOShaderUniformTypeVector , kOOShaderUniformTypeHPVector , kOOShaderUniformTypeQuaternion ,
  kOOShaderUniformTypeMatrix , kOOShaderUniformTypePoint , kOOShaderUniformTypeObject , kOOShaderUniformTypeCount
}
 

Functions

OOShaderUniformType OOShaderUniformTypeFromMethodSignature (NSMethodSignature *signature)
 
long long OOCallIntegerMethod (id object, SEL selector, IMP method, OOShaderUniformType type)
 
double OOCallFloatMethod (id object, SEL selector, IMP method, OOShaderUniformType type)
 

Typedef Documentation

◆ CharReturnMsgSend

typedef char(* CharReturnMsgSend) (id, SEL)

Definition at line 72 of file OOShaderUniformMethodType.h.

◆ DoubleReturnMsgSend

typedef double(* DoubleReturnMsgSend) (id, SEL)

Definition at line 83 of file OOShaderUniformMethodType.h.

◆ FloatReturnMsgSend

typedef float(* FloatReturnMsgSend) (id, SEL)

Definition at line 82 of file OOShaderUniformMethodType.h.

◆ HPVectorReturnMsgSend

typedef HPVector(* HPVectorReturnMsgSend) (id, SEL)

Definition at line 85 of file OOShaderUniformMethodType.h.

◆ IntReturnMsgSend

typedef int(* IntReturnMsgSend) (id, SEL)

Definition at line 76 of file OOShaderUniformMethodType.h.

◆ LongLongReturnMsgSend

typedef long long(* LongLongReturnMsgSend) (id, SEL)

Definition at line 80 of file OOShaderUniformMethodType.h.

◆ LongReturnMsgSend

typedef long(* LongReturnMsgSend) (id, SEL)

Definition at line 78 of file OOShaderUniformMethodType.h.

◆ MatrixReturnMsgSend

typedef OOMatrix(* MatrixReturnMsgSend) (id, SEL)

Definition at line 87 of file OOShaderUniformMethodType.h.

◆ ObjectReturnMsgSend

typedef id(* ObjectReturnMsgSend) (id, SEL)

Definition at line 89 of file OOShaderUniformMethodType.h.

◆ PointReturnMsgSend

typedef NSPoint(* PointReturnMsgSend) (id, SEL)

Definition at line 88 of file OOShaderUniformMethodType.h.

◆ QuaternionReturnMsgSend

typedef Quaternion(* QuaternionReturnMsgSend) (id, SEL)

Definition at line 86 of file OOShaderUniformMethodType.h.

◆ ShortReturnMsgSend

typedef short(* ShortReturnMsgSend) (id, SEL)

Definition at line 74 of file OOShaderUniformMethodType.h.

◆ UnsignedCharReturnMsgSend

typedef unsigned char(* UnsignedCharReturnMsgSend) (id, SEL)

Definition at line 73 of file OOShaderUniformMethodType.h.

◆ UnsignedIntReturnMsgSend

typedef unsigned int(* UnsignedIntReturnMsgSend) (id, SEL)

Definition at line 77 of file OOShaderUniformMethodType.h.

◆ UnsignedLongLongReturnMsgSend

typedef unsigned long long(* UnsignedLongLongReturnMsgSend) (id, SEL)

Definition at line 81 of file OOShaderUniformMethodType.h.

◆ UnsignedLongReturnMsgSend

typedef unsigned long(* UnsignedLongReturnMsgSend) (id, SEL)

Definition at line 79 of file OOShaderUniformMethodType.h.

◆ UnsignedShortReturnMsgSend

typedef unsigned short(* UnsignedShortReturnMsgSend) (id, SEL)

Definition at line 75 of file OOShaderUniformMethodType.h.

◆ VectorReturnMsgSend

typedef Vector(* VectorReturnMsgSend) (id, SEL)

Definition at line 84 of file OOShaderUniformMethodType.h.

Enumeration Type Documentation

◆ OOShaderUniformType

Enumerator
kOOShaderUniformTypeInvalid 
kOOShaderUniformTypeChar 
kOOShaderUniformTypeUnsignedChar 
kOOShaderUniformTypeShort 
kOOShaderUniformTypeUnsignedShort 
kOOShaderUniformTypeInt 
kOOShaderUniformTypeUnsignedInt 
kOOShaderUniformTypeLong 
kOOShaderUniformTypeUnsignedLong 
kOOShaderUniformTypeLongLong 
kOOShaderUniformTypeUnsignedLongLong 
kOOShaderUniformTypeFloat 
kOOShaderUniformTypeDouble 
kOOShaderUniformTypeVector 
kOOShaderUniformTypeHPVector 
kOOShaderUniformTypeQuaternion 
kOOShaderUniformTypeMatrix 
kOOShaderUniformTypePoint 
kOOShaderUniformTypeObject 
kOOShaderUniformTypeCount 

Definition at line 39 of file OOShaderUniformMethodType.h.

40{
41 kOOShaderUniformTypeInvalid, // Not valid for bindings or constants
42
43 kOOShaderUniformTypeChar, // Binding only
45 kOOShaderUniformTypeShort, // Binding only
47 kOOShaderUniformTypeInt, // Binding or constant
48 kOOShaderUniformTypeUnsignedInt, // Binding only
49 kOOShaderUniformTypeLong, // Binding only
51 kOOShaderUniformTypeLongLong, // Binding only
53 kOOShaderUniformTypeFloat, // Binding or constant
54 kOOShaderUniformTypeDouble, // Binding only
55 kOOShaderUniformTypeVector, // Binding or constant
56 kOOShaderUniformTypeHPVector, // Binding only
57 kOOShaderUniformTypeQuaternion, // Binding or constant
58 kOOShaderUniformTypeMatrix, // Binding or constant
59 kOOShaderUniformTypePoint, // Binding only
60 kOOShaderUniformTypeObject, // Binding only
61
62 kOOShaderUniformTypeCount // Not valid for bindings or constants
@ kOOShaderUniformTypeCount
@ kOOShaderUniformTypeQuaternion
@ kOOShaderUniformTypeMatrix
@ kOOShaderUniformTypeVector
@ kOOShaderUniformTypeLong
@ kOOShaderUniformTypeUnsignedChar
@ kOOShaderUniformTypeShort
@ kOOShaderUniformTypePoint
@ kOOShaderUniformTypeUnsignedLong
@ kOOShaderUniformTypeFloat
@ kOOShaderUniformTypeUnsignedInt
@ kOOShaderUniformTypeUnsignedShort
@ kOOShaderUniformTypeLongLong
@ kOOShaderUniformTypeUnsignedLongLong
@ kOOShaderUniformTypeDouble
@ kOOShaderUniformTypeObject
@ kOOShaderUniformTypeHPVector
@ kOOShaderUniformTypeInt
@ kOOShaderUniformTypeChar
@ kOOShaderUniformTypeInvalid

Function Documentation

◆ OOCallFloatMethod()

double OOCallFloatMethod ( id object,
SEL selector,
IMP method,
OOShaderUniformType type )

Definition at line 288 of file OOShaderUniformMethodType.m.

289{
290 switch (type)
291 {
293 return ((FloatReturnMsgSend)method)(object, selector);
294
296 return ((DoubleReturnMsgSend)method)(object, selector);
297
298 default:
299 return 0;
300 }
301}
double(* DoubleReturnMsgSend)(id, SEL)
float(* FloatReturnMsgSend)(id, SEL)

◆ OOCallIntegerMethod()

long long OOCallIntegerMethod ( id object,
SEL selector,
IMP method,
OOShaderUniformType type )

Definition at line 248 of file OOShaderUniformMethodType.m.

249{
250 switch (type)
251 {
253 return ((CharReturnMsgSend)method)(object, selector);
254
256 return ((UnsignedCharReturnMsgSend)method)(object, selector);
257
259 return ((ShortReturnMsgSend)method)(object, selector);
260
262 return ((UnsignedShortReturnMsgSend)method)(object, selector);
263
265 return ((IntReturnMsgSend)method)(object, selector);
266
268 return ((UnsignedIntReturnMsgSend)method)(object, selector);
269
271 return ((LongReturnMsgSend)method)(object, selector);
272
274 return ((UnsignedLongReturnMsgSend)method)(object, selector);
275
277 return ((LongLongReturnMsgSend)method)(object, selector);
278
280 return ((UnsignedLongLongReturnMsgSend)method)(object, selector);
281
282 default:
283 return 0;
284 }
285}
int(* IntReturnMsgSend)(id, SEL)
unsigned int(* UnsignedIntReturnMsgSend)(id, SEL)
char(* CharReturnMsgSend)(id, SEL)
long long(* LongLongReturnMsgSend)(id, SEL)
short(* ShortReturnMsgSend)(id, SEL)
unsigned char(* UnsignedCharReturnMsgSend)(id, SEL)
unsigned long(* UnsignedLongReturnMsgSend)(id, SEL)
unsigned short(* UnsignedShortReturnMsgSend)(id, SEL)
unsigned long long(* UnsignedLongLongReturnMsgSend)(id, SEL)
long(* LongReturnMsgSend)(id, SEL)

References kOOShaderUniformTypeChar, kOOShaderUniformTypeInt, kOOShaderUniformTypeLong, kOOShaderUniformTypeLongLong, kOOShaderUniformTypeShort, kOOShaderUniformTypeUnsignedChar, kOOShaderUniformTypeUnsignedInt, kOOShaderUniformTypeUnsignedLong, kOOShaderUniformTypeUnsignedLongLong, and kOOShaderUniformTypeUnsignedShort.

◆ OOShaderUniformTypeFromMethodSignature()

OOShaderUniformType OOShaderUniformTypeFromMethodSignature ( NSMethodSignature * signature)

Definition at line 62 of file OOShaderUniformMethodType.m.

63{
64 unsigned i;
65 const char *typeCode = NULL;
66
67 if (EXPECT_NOT(sInited == NO)) InitTemplates();
68
69 typeCode = [signature methodReturnType];
70 if (EXPECT_NOT(typeCode == NULL)) return kOOShaderUniformTypeInvalid;
71
73 {
74 if (sTemplates[i] != NULL && strcmp(sTemplates[i], typeCode) == 0) return i;
75 }
76
78}
#define EXPECT_NOT(x)
static void InitTemplates(void)
static const char * sTemplates[kOOShaderUniformTypeCount]
static BOOL sInited

References EXPECT_NOT, InitTemplates(), kOOShaderUniformTypeCount, kOOShaderUniformTypeInvalid, sInited, and sTemplates.

Referenced by OOJSCallMethodSignatureTemplateClass::objectObjectMethod:.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: