Oolite
Loading...
Searching...
No Matches
OOShaderUniformMethodType.h
Go to the documentation of this file.
1/*
2
3OOShaderUniformMethodType.h
4
5Type code declarations and OpenStep implementation agnostic method type
6matching for uniform bindings.
7
8
9Copyright (C) 2007-2013 Jens Ayton
10
11Permission is hereby granted, free of charge, to any person obtaining a copy
12of this software and associated documentation files (the "Software"), to deal
13in the Software without restriction, including without limitation the rights
14to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15copies of the Software, and to permit persons to whom the Software is
16furnished to do so, subject to the following conditions:
17
18The above copyright notice and this permission notice shall be included in all
19copies or substantial portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27SOFTWARE.
28
29*/
30
32
33#if OO_SHADERS || defined(OO_DEBUG_MONITOR_ENABLED)
34
35#import "OOMaths.h"
36
37typedef enum {
38 kOOShaderUniformTypeInvalid, // Not valid for bindings or constants
39
40 kOOShaderUniformTypeChar, // Binding only
41 kOOShaderUniformTypeUnsignedChar, // Binding only
42 kOOShaderUniformTypeShort, // Binding only
43 kOOShaderUniformTypeUnsignedShort, // Binding only
44 kOOShaderUniformTypeInt, // Binding or constant
45 kOOShaderUniformTypeUnsignedInt, // Binding only
46 kOOShaderUniformTypeLong, // Binding only
47 kOOShaderUniformTypeUnsignedLong, // Binding only
48 kOOShaderUniformTypeLongLong, // Binding only
49 kOOShaderUniformTypeUnsignedLongLong, // Binding only
50 kOOShaderUniformTypeFloat, // Binding or constant
51 kOOShaderUniformTypeDouble, // Binding only
52 kOOShaderUniformTypeVector, // Binding or constant
53 kOOShaderUniformTypeHPVector, // Binding only
54 kOOShaderUniformTypeQuaternion, // Binding or constant
55 kOOShaderUniformTypeMatrix, // Binding or constant
56 kOOShaderUniformTypePoint, // Binding only
57 kOOShaderUniformTypeObject, // Binding only
58
59 kOOShaderUniformTypeCount // Not valid for bindings or constants
60} OOShaderUniformType;
61
62OOShaderUniformType OOShaderUniformTypeFromMethodSignature(NSMethodSignature* signature);
63
64long long OOCallIntegerMethod(id object, SEL selector, IMP method, OOShaderUniformType type);
65double OOCallFloatMethod(id object, SEL selector, IMP method, OOShaderUniformType type);
66
67typedef char (*CharReturnMsgSend)(id, SEL);
68typedef unsigned char (*UnsignedCharReturnMsgSend)(id, SEL);
69typedef short (*ShortReturnMsgSend)(id, SEL);
70typedef unsigned short (*UnsignedShortReturnMsgSend)(id, SEL);
71typedef int (*IntReturnMsgSend)(id, SEL);
72typedef unsigned int (*UnsignedIntReturnMsgSend)(id, SEL);
73typedef long (*LongReturnMsgSend)(id, SEL);
74typedef unsigned long (*UnsignedLongReturnMsgSend)(id, SEL);
75typedef long long (*LongLongReturnMsgSend)(id, SEL);
76typedef unsigned long long (*UnsignedLongLongReturnMsgSend)(id, SEL);
77typedef float (*FloatReturnMsgSend)(id, SEL);
78typedef double (*DoubleReturnMsgSend)(id, SEL);
79typedef Vector (*VectorReturnMsgSend)(id, SEL);
80typedef HPVector (*HPVectorReturnMsgSend)(id, SEL);
81typedef Quaternion (*QuaternionReturnMsgSend)(id, SEL);
82typedef OOMatrix (*MatrixReturnMsgSend)(id, SEL);
83typedef NSPoint (*PointReturnMsgSend)(id, SEL);
84typedef id (*ObjectReturnMsgSend)(id, SEL);
85
86#endif // OO_SHADERS
struct HPVector HPVector
struct OOMatrix OOMatrix
struct Quaternion Quaternion
struct Vector Vector
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque