Changeset 262
- Timestamp:
- 05/17/07 06:31:49 (1 year ago)
- Files:
-
- trunk/DerelictGL/derelict/opengl/gl.d (modified) (8 diffs)
- trunk/DerelictUtil/derelict/util/loader.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/DerelictGL/derelict/opengl/gl.d
r261 r262 54 54 import derelict.opengl.wgl; 55 55 import derelict.util.wintypes; 56 alias HGLRC DerelictGLContext; 56 57 } 57 58 else version(linux) … … 65 66 66 67 version(UsingGLX) 68 { 67 69 import derelict.opengl.glx; 70 alias GLXContext DerelictGLContext; 71 } 68 72 } 69 73 … … 114 118 HDC hdc = wglGetCurrentDC(); 115 119 if(hdc is null) 116 throw new Exception("Could not obtain a device context for the current OpenGL context");120 throw new DerelictException("Could not obtain a device context for the current OpenGL context"); 117 121 118 122 if(0 == currentPixelFormat) … … 124 128 int newFormat = GetPixelFormat(hdc); 125 129 if(0 == newFormat) 126 throw new Exception("Could not determine current pixel format");130 throw new DerelictException("Could not determine current pixel format"); 127 131 128 132 bool ret = true; … … 171 175 return false; 172 176 } 177 else throw new DerelictException("DerelictGL.hasValidContext is unimplemented for this platform"); 178 173 179 return true; 174 180 } 181 182 static DerelictGLContext getCurrentContext() 183 { 184 version(Windows) return wglGetCurrentContext(); 185 else version(UsingGLX) return glXGetCurrentContext(); 186 else throw new DerelictException("DerelictGL.getCurrentContext is Unimplemented for this platform"); 187 } 175 188 176 189 static void loadVersions(GLVersion minVersion) … … 179 192 { 180 193 if(!hasValidContext) 181 throw new Exception("You must create an OpenGL context before attempting to load OpenGL versions later than 1.1");194 throw new DerelictException("You must create an OpenGL context before attempting to load OpenGL versions later than 1.1"); 182 195 } 183 196 … … 237 250 { 238 251 if(!hasValidContext) 239 throw new Exception("You must create an OpenGL context before attempting to load OpenGL extensions");252 throw new DerelictException("You must create an OpenGL context before attempting to load OpenGL extensions"); 240 253 241 254 if(extensionsOnce) … … 293 306 { 294 307 if(!hasValidContext) 295 throw new Exception("You must create an OpenGL context before attempting to check the OpenGL version");308 throw new DerelictException("You must create an OpenGL context before attempting to check the OpenGL version"); 296 309 297 310 char[] str = toDString(glGetString(GL_VERSION)); trunk/DerelictUtil/derelict/util/loader.d
r261 r262 385 385 if(userLoad is null) 386 386 { 387 throw new DerelictException("The internal load function has not been configured. You are most likely calling a Derelict load method from a module constructor, or a static class constructor. Don't."); 387 // this should never, ever, happen 388 throw new DerelictException("Something is horribly wrong -- internal load function not configured"); 388 389 } 389 390 userLoad(myLib);
