Mercurial > projects > mde
comparison mde/sdl.d @ 55:f3d8c0441408
Implemented gl.texture (without testing) & fixed log options adjusted previously.
Implemented gl.texture module to load textures from file (untested).
Fixed log level/option setting in Init.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Tue, 10 Jun 2008 17:35:13 +0100 |
parents | c81342b54ef2 |
children |
comparison
equal
deleted
inserted
replaced
54:c81342b54ef2 | 55:f3d8c0441408 |
---|---|
120 } | 120 } |
121 | 121 |
122 /* Now (must be done after GL context is created) we can try to load later version. | 122 /* Now (must be done after GL context is created) we can try to load later version. |
123 * The initial loading provides opengl 1.1 features. | 123 * The initial loading provides opengl 1.1 features. |
124 * | 124 * |
125 * 1.4 is now used for glBlendColor (coloured text). | |
126 * | |
125 * Currently the latest version used is 1.3; adjust this as necessary. However, before using | 127 * Currently the latest version used is 1.3; adjust this as necessary. However, before using |
126 * features from any OpenGL version > 1.1 a check must be made on what was loaded by calling | 128 * features from any OpenGL version > 1.1 a check must be made on what was loaded by calling |
127 * DerelictGL.availableVersion(). Note that availableVersion() could be used instead to load | 129 * DerelictGL.availableVersion(). Note that availableVersion() could be used instead to load |
128 * the highest supported version but this way we know what we're getting. | 130 * the highest supported version but this way we know what we're getting. |
129 */ | 131 */ |
130 try { | 132 if (DerelictGL.availableVersion < GLVersion.Version13) { |
131 DerelictGL.loadVersions(GLVersion.Version13); | 133 logger.fatal ("Required at least OpenGL 1.3"); |
134 setInitFailure; | |
135 return; | |
136 } | |
137 /+try { | |
138 DerelictGL.loadVersions(GLVersion.Version14); | |
132 } catch (SharedLibProcLoadException e) { | 139 } catch (SharedLibProcLoadException e) { |
133 logger.warn ("Loading OpenGL version 1.3 failed:"); | 140 logger.warn ("Loading OpenGL version 1.4 failed:"); |
134 logger.warn (e.msg); | 141 logger.warn (e.msg); |
135 | 142 |
136 //NOTE: might be worth guaranteeing a minimal version to save later checks? | 143 //NOTE: might be worth guaranteeing a minimal version to save later checks? |
137 /+ Do this if you want the program to abort: | 144 /+ Do this if you want the program to abort: |
138 setInitFailure (); | 145 setInitFailure (); |
139 return; | 146 return; |
140 +/ | 147 +/ |
141 } | 148 }+/ |
142 | 149 |
143 // OpenGL stuff: | 150 // OpenGL stuff: |
144 glSetup(); | 151 glSetup(); |
145 setProjection (w, h); | 152 setProjection (w, h); |
146 | 153 |