1 {
2 Copyright: (c) 1999-2008 Apple Inc. All rights reserved.
3 }
4 { Pascal Translation: Gorazd Krosl, <gorazd_1957@yahoo.ca>, October 2009 }
5
6 {
7 Modified for use with Free Pascal
8 Version 308
9 Please report any bugs to <gpc@microbizz.nl>
10 }
11
12 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
13 {$mode macpas}
14 {$modeswitch cblocks}
15 {$packenum 1}
16 {$macro on}
17 {$inline on}
18 {$calling mwpascal}
19
20 unit CGLCurrent;
21 interface
22 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
23 {$setc GAP_INTERFACES_VERSION := $0308}
24
25 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
26 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
27 {$endc}
28
29 {$ifc defined CPUPOWERPC and defined CPUI386}
30 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
31 {$endc}
32 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
33 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
34 {$endc}
35
36 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
37 {$setc __ppc__ := 1}
38 {$elsec}
39 {$setc __ppc__ := 0}
40 {$endc}
41 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
42 {$setc __ppc64__ := 1}
43 {$elsec}
44 {$setc __ppc64__ := 0}
45 {$endc}
46 {$ifc not defined __i386__ and defined CPUI386}
47 {$setc __i386__ := 1}
48 {$elsec}
49 {$setc __i386__ := 0}
50 {$endc}
51 {$ifc not defined __x86_64__ and defined CPUX86_64}
52 {$setc __x86_64__ := 1}
53 {$elsec}
54 {$setc __x86_64__ := 0}
55 {$endc}
56 {$ifc not defined __arm__ and defined CPUARM}
57 {$setc __arm__ := 1}
58 {$elsec}
59 {$setc __arm__ := 0}
60 {$endc}
61 {$ifc not defined __arm64__ and defined CPUAARCH64}
62 {$setc __arm64__ := 1}
63 {$elsec}
64 {$setc __arm64__ := 0}
65 {$endc}
66
67 {$ifc defined cpu64}
68 {$setc __LP64__ := 1}
69 {$elsec}
70 {$setc __LP64__ := 0}
71 {$endc}
72
73
74 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
75 {$error Conflicting definitions for __ppc__ and __i386__}
76 {$endc}
77
78 {$ifc defined __ppc__ and __ppc__}
79 {$setc TARGET_CPU_PPC := TRUE}
80 {$setc TARGET_CPU_PPC64 := FALSE}
81 {$setc TARGET_CPU_X86 := FALSE}
82 {$setc TARGET_CPU_X86_64 := FALSE}
83 {$setc TARGET_CPU_ARM := FALSE}
84 {$setc TARGET_CPU_ARM64 := FALSE}
85 {$setc TARGET_OS_MAC := TRUE}
86 {$setc TARGET_OS_IPHONE := FALSE}
87 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
88 {$setc TARGET_OS_EMBEDDED := FALSE}
89 {$elifc defined __ppc64__ and __ppc64__}
90 {$setc TARGET_CPU_PPC := FALSE}
91 {$setc TARGET_CPU_PPC64 := TRUE}
92 {$setc TARGET_CPU_X86 := FALSE}
93 {$setc TARGET_CPU_X86_64 := FALSE}
94 {$setc TARGET_CPU_ARM := FALSE}
95 {$setc TARGET_CPU_ARM64 := FALSE}
96 {$setc TARGET_OS_MAC := TRUE}
97 {$setc TARGET_OS_IPHONE := FALSE}
98 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
99 {$setc TARGET_OS_EMBEDDED := FALSE}
100 {$elifc defined __i386__ and __i386__}
101 {$setc TARGET_CPU_PPC := FALSE}
102 {$setc TARGET_CPU_PPC64 := FALSE}
103 {$setc TARGET_CPU_X86 := TRUE}
104 {$setc TARGET_CPU_X86_64 := FALSE}
105 {$setc TARGET_CPU_ARM := FALSE}
106 {$setc TARGET_CPU_ARM64 := FALSE}
107 {$ifc defined iphonesim}
108 {$setc TARGET_OS_MAC := FALSE}
109 {$setc TARGET_OS_IPHONE := TRUE}
110 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
111 {$elsec}
112 {$setc TARGET_OS_MAC := TRUE}
113 {$setc TARGET_OS_IPHONE := FALSE}
114 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
115 {$endc}
116 {$setc TARGET_OS_EMBEDDED := FALSE}
117 {$elifc defined __x86_64__ and __x86_64__}
118 {$setc TARGET_CPU_PPC := FALSE}
119 {$setc TARGET_CPU_PPC64 := FALSE}
120 {$setc TARGET_CPU_X86 := FALSE}
121 {$setc TARGET_CPU_X86_64 := TRUE}
122 {$setc TARGET_CPU_ARM := FALSE}
123 {$setc TARGET_CPU_ARM64 := FALSE}
124 {$ifc defined iphonesim}
125 {$setc TARGET_OS_MAC := FALSE}
126 {$setc TARGET_OS_IPHONE := TRUE}
127 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
128 {$elsec}
129 {$setc TARGET_OS_MAC := TRUE}
130 {$setc TARGET_OS_IPHONE := FALSE}
131 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
132 {$endc}
133 {$setc TARGET_OS_EMBEDDED := FALSE}
134 {$elifc defined __arm__ and __arm__}
135 {$setc TARGET_CPU_PPC := FALSE}
136 {$setc TARGET_CPU_PPC64 := FALSE}
137 {$setc TARGET_CPU_X86 := FALSE}
138 {$setc TARGET_CPU_X86_64 := FALSE}
139 {$setc TARGET_CPU_ARM := TRUE}
140 {$setc TARGET_CPU_ARM64 := FALSE}
141 {$setc TARGET_OS_MAC := FALSE}
142 {$setc TARGET_OS_IPHONE := TRUE}
143 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
144 {$setc TARGET_OS_EMBEDDED := TRUE}
145 {$elifc defined __arm64__ and __arm64__}
146 {$setc TARGET_CPU_PPC := FALSE}
147 {$setc TARGET_CPU_PPC64 := FALSE}
148 {$setc TARGET_CPU_X86 := FALSE}
149 {$setc TARGET_CPU_X86_64 := FALSE}
150 {$setc TARGET_CPU_ARM := FALSE}
151 {$setc TARGET_CPU_ARM64 := TRUE}
152 {$ifc defined ios}
153 {$setc TARGET_OS_MAC := FALSE}
154 {$setc TARGET_OS_IPHONE := TRUE}
155 {$setc TARGET_OS_EMBEDDED := TRUE}
156 {$elsec}
157 {$setc TARGET_OS_MAC := TRUE}
158 {$setc TARGET_OS_IPHONE := FALSE}
159 {$setc TARGET_OS_EMBEDDED := FALSE}
160 {$endc}
161 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
162 {$elsec}
163 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
164 {$endc}
165
166 {$ifc defined __LP64__ and __LP64__ }
167 {$setc TARGET_CPU_64 := TRUE}
168 {$elsec}
169 {$setc TARGET_CPU_64 := FALSE}
170 {$endc}
171
172 {$ifc defined FPC_BIG_ENDIAN}
173 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
174 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
175 {$elifc defined FPC_LITTLE_ENDIAN}
176 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
177 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
178 {$elsec}
179 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
180 {$endc}
181 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
182 {$setc CALL_NOT_IN_CARBON := FALSE}
183 {$setc OLDROUTINENAMES := FALSE}
184 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
185 {$setc OPAQUE_UPP_TYPES := TRUE}
186 {$setc OTCARBONAPPLICATION := TRUE}
187 {$setc OTKERNEL := FALSE}
188 {$setc PM_USE_SESSION_APIS := TRUE}
189 {$setc TARGET_API_MAC_CARBON := TRUE}
190 {$setc TARGET_API_MAC_OS8 := FALSE}
191 {$setc TARGET_API_MAC_OSX := TRUE}
192 {$setc TARGET_CARBON := TRUE}
193 {$setc TARGET_CPU_68K := FALSE}
194 {$setc TARGET_CPU_MIPS := FALSE}
195 {$setc TARGET_CPU_SPARC := FALSE}
196 {$setc TARGET_OS_UNIX := FALSE}
197 {$setc TARGET_OS_WIN32 := FALSE}
198 {$setc TARGET_RT_MAC_68881 := FALSE}
199 {$setc TARGET_RT_MAC_CFM := FALSE}
200 {$setc TARGET_RT_MAC_MACHO := TRUE}
201 {$setc TYPED_FUNCTION_POINTERS := TRUE}
202 {$setc TYPE_BOOL := FALSE}
203 {$setc TYPE_EXTENDED := FALSE}
204 {$setc TYPE_LONGLONG := TRUE}
205 uses MacTypes,CGLTypes;
206 {$endc} {not MACOSALLINCLUDE}
207
208
209 {$ifc TARGET_OS_MAC}
210
211 {$ALIGN POWER}
212
213
214 {
215 ** Current context functions
216 }
CGLSetCurrentContextnull217 function CGLSetCurrentContext( ctx: CGLContextObj ): CGLError; external name '_CGLSetCurrentContext';
CGLGetCurrentContextnull218 function CGLGetCurrentContext: CGLContextObj; external name '_CGLGetCurrentContext';
219
220 {$endc} {TARGET_OS_MAC}
221 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
222
223 end.
224 {$endc} {not MACOSALLINCLUDE}
225