comparison docs/html/sdlglgetprocaddress.html @ 0:74212992fb08

Initial revision
author Sam Lantinga <slouken@lokigames.com>
date Thu, 26 Apr 2001 16:45:43 +0000
parents
children 55f1f1b3e27d
comparison
equal deleted inserted replaced
-1:000000000000 0:74212992fb08
1 <HTML
2 ><HEAD
3 ><TITLE
4 >SDL_GL_GetProcAddress</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.61
8 "><LINK
9 REL="HOME"
10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="Video"
14 HREF="video.html"><LINK
15 REL="PREVIOUS"
16 TITLE="SDL_GL_LoadLibrary"
17 HREF="sdlglloadlibrary.html"><LINK
18 REL="NEXT"
19 TITLE="SDL_GL_GetAttribute"
20 HREF="sdlglgetattribute.html"></HEAD
21 ><BODY
22 CLASS="REFENTRY"
23 BGCOLOR="#FFF8DC"
24 TEXT="#000000"
25 LINK="#0000ee"
26 VLINK="#551a8b"
27 ALINK="#ff0000"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >SDL Library Documentation</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="sdlglloadlibrary.html"
48 >Prev</A
49 ></TD
50 ><TD
51 WIDTH="80%"
52 ALIGN="center"
53 VALIGN="bottom"
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="right"
58 VALIGN="bottom"
59 ><A
60 HREF="sdlglgetattribute.html"
61 >Next</A
62 ></TD
63 ></TR
64 ></TABLE
65 ><HR
66 ALIGN="LEFT"
67 WIDTH="100%"></DIV
68 ><H1
69 ><A
70 NAME="SDLGLGETPROCADDRESS"
71 >SDL_GL_GetProcAddress</A
72 ></H1
73 ><DIV
74 CLASS="REFNAMEDIV"
75 ><A
76 NAME="AEN2180"
77 ></A
78 ><H2
79 >Name</H2
80 >SDL_GL_GetProcAddress&nbsp;--&nbsp;Get the address of a GL function</DIV
81 ><DIV
82 CLASS="REFSYNOPSISDIV"
83 ><A
84 NAME="AEN2183"
85 ></A
86 ><H2
87 >Synopsis</H2
88 ><DIV
89 CLASS="FUNCSYNOPSIS"
90 ><A
91 NAME="AEN2184"
92 ></A
93 ><P
94 ></P
95 ><PRE
96 CLASS="FUNCSYNOPSISINFO"
97 >#include "SDL.h"</PRE
98 ><P
99 ><CODE
100 ><CODE
101 CLASS="FUNCDEF"
102 >void *<B
103 CLASS="FSFUNC"
104 >SDL_GL_GetProcAddress</B
105 ></CODE
106 >(const char* proc);</CODE
107 ></P
108 ><P
109 ></P
110 ></DIV
111 ></DIV
112 ><DIV
113 CLASS="REFSECT1"
114 ><A
115 NAME="AEN2190"
116 ></A
117 ><H2
118 >Description</H2
119 ><P
120 >Returns the address of the GL function <TT
121 CLASS="PARAMETER"
122 ><I
123 >proc</I
124 ></TT
125 >, or <SPAN
126 CLASS="RETURNVALUE"
127 >NULL</SPAN
128 > if the function is not found. If the GL library is loaded at runtime, with <A
129 HREF="sdlglloadlibrary.html"
130 ><TT
131 CLASS="FUNCTION"
132 >SDL_GL_LoadLibrary</TT
133 ></A
134 >, then <I
135 CLASS="EMPHASIS"
136 >all</I
137 > GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.</P
138 ></DIV
139 ><DIV
140 CLASS="REFSECT1"
141 ><A
142 NAME="AEN2198"
143 ></A
144 ><H2
145 >Example</H2
146 ><PRE
147 CLASS="PROGRAMLISTING"
148 >typedef void (*GL_ActiveTextureARB_Func)(unsigned int);
149 GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
150 int has_multitexture=1;
151 .
152 .
153 .
154 /* Get function pointer */
155 glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
156
157 /* Check for a valid function ptr */
158 if(!glActiveTextureARB_ptr){
159 fprintf(stderr, "Multitexture Extensions not present.\n");
160 has_multitexture=0;
161 }
162 .
163 .
164 .
165 .
166 if(has_multitexture){
167 glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
168 .
169 .
170 }
171 else{
172 .
173 .
174 }</PRE
175 ></DIV
176 ><DIV
177 CLASS="REFSECT1"
178 ><A
179 NAME="AEN2201"
180 ></A
181 ><H2
182 >See Also</H2
183 ><P
184 ><A
185 HREF="sdlglloadlibrary.html"
186 ><TT
187 CLASS="FUNCTION"
188 >SDL_GL_LoadLibrary</TT
189 ></A
190 ></P
191 ></DIV
192 ><DIV
193 CLASS="NAVFOOTER"
194 ><HR
195 ALIGN="LEFT"
196 WIDTH="100%"><TABLE
197 WIDTH="100%"
198 BORDER="0"
199 CELLPADDING="0"
200 CELLSPACING="0"
201 ><TR
202 ><TD
203 WIDTH="33%"
204 ALIGN="left"
205 VALIGN="top"
206 ><A
207 HREF="sdlglloadlibrary.html"
208 >Prev</A
209 ></TD
210 ><TD
211 WIDTH="34%"
212 ALIGN="center"
213 VALIGN="top"
214 ><A
215 HREF="index.html"
216 >Home</A
217 ></TD
218 ><TD
219 WIDTH="33%"
220 ALIGN="right"
221 VALIGN="top"
222 ><A
223 HREF="sdlglgetattribute.html"
224 >Next</A
225 ></TD
226 ></TR
227 ><TR
228 ><TD
229 WIDTH="33%"
230 ALIGN="left"
231 VALIGN="top"
232 >SDL_GL_LoadLibrary</TD
233 ><TD
234 WIDTH="34%"
235 ALIGN="center"
236 VALIGN="top"
237 ><A
238 HREF="video.html"
239 >Up</A
240 ></TD
241 ><TD
242 WIDTH="33%"
243 ALIGN="right"
244 VALIGN="top"
245 >SDL_GL_GetAttribute</TD
246 ></TR
247 ></TABLE
248 ></DIV
249 ></BODY
250 ></HTML
251 >