Changeset 55:f3d8c0441408

Show
Ignore:
Timestamp:
06/10/08 12:35:13 (7 months ago)
Author:
Diggory Hardy <diggory.hardy@gmail.com>
branch:
default
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • codeDoc/jobs.txt

    r53 r55  
    99To do (importance 0-5: 0 pointless, 1 no obvious impact now, 2 todo sometime, 3 useful, 4 important, 5 urgent): 
    1010Also see todo.txt and FIXME/NOTE comment marks. 
    11 5   mergetag crashes with no ending > on a tag and doesn't add header data when comments are included! 
    12 4   LCD filtering / fonts from Options. Get yMax for font not all glyphs on line? 
     114   Fonts from Options. Get yMax for font not all glyphs on line? 
    13124   Not guaranteed to catch up-click ending callback! Appears not to be a problem... 
    14134   OutOfMemoryException is not currently checked for − it should be at least in critical places (use high-level catching of all errors?). 
     
    5352 
    5453Done (for git log message): 
     54Implemented gl.texture module to load textures from file (untested). 
     55Fixed log level/option setting in Init. 
  • data/conf/options.mtt

    r53 r55  
    44<bool|exitImmediately=false> 
    55<char[]|L10n="en-GB"> 
    6 <int|logLevel=1> 
    7 <int|logOptions=0x1003> 
     6<int|logOptions=0x3001> 
    87<double|pollInterval=0.01> 
    98 
  • mde/exception.d

    r29 r55  
    6767} 
    6868 
     69/// Thrown when an image fails to load or cannot be loaded to a texture (unsupported format?). 
     70class ImageException : mdeException { 
     71    char[] getSymbol () { 
     72        return super.getSymbol ~ ".gl.texture"; 
     73    } 
     74    this (char[] msg) { 
     75        super (msg); 
     76    } 
     77} 
     78 
     79 
    6980debug (mdeUnitTest) { 
    7081    import tango.util.log.Log : Log, Logger; 
  • mde/gl/draw.d

    r49 r55  
    4242     
    4343    GLenum err = glGetError(); 
    44     if (err != GL_NO_ERROR) { 
     44    while (err != GL_NO_ERROR) { 
    4545        char[128] tmp; 
    4646        logger.error (logger.format (tmp, "GL error: {}", err)); 
     47        err = glGetError(); 
    4748    } 
    4849     
  • mde/scheduler/Init.d

    r53 r55  
    5151import derelict.opengl.gl; 
    5252import derelict.sdl.sdl; 
     53import derelict.sdl.image; 
    5354import derelict.freetype.ft; 
    5455import derelict.util.exception; 
     
    161162    try { 
    162163            enum LOG { 
    163                 LEVEL   = 0x10,       // mask for log level 
    164                 CONSOLE = 0x1001, // log to console? 
    165                 ROLLFILE= 0x1002  // use Rolling/Switching File Appender? 
     164                LEVEL   = 0xF,        // mask for log level 
     165                CONSOLE = 0x1000, // log to console? 
     166                ROLLFILE= 0x2000  // use Rolling/Switching File Appender? 
    166167            } 
    167168             
     
    171172         
    172173            // Now re-set the logging level, using the value from the config file: 
    173             Log.getRootLogger.setLevel (cast(Log.Level) (miscOpts.logOptions & LOG.LEVEL), true); 
     174            root.setLevel (cast(Log.Level) (miscOpts.logOptions & LOG.LEVEL), true); 
    174175             
    175176            // Log to a file (first appender so root seperator messages don't show on console): 
     
    208209        try { 
    209210            DerelictSDL.load(); 
     211            DerelictSDLImage.load(); 
    210212            DerelictGL.load(); 
    211213            DerelictFT.load(); 
  • mde/sdl.d

    r54 r55  
    123123     * The initial loading provides opengl 1.1 features. 
    124124     * 
     125     * 1.4 is now used for glBlendColor (coloured text). 
     126     * 
    125127     * Currently the latest version used is 1.3; adjust this as necessary. However, before using 
    126128     * features from any OpenGL version > 1.1 a check must be made on what was loaded by calling 
     
    128130     * the highest supported version but this way we know what we're getting. 
    129131     */ 
    130     try { 
    131         DerelictGL.loadVersions(GLVersion.Version13); 
     132    if (DerelictGL.availableVersion < GLVersion.Version13) { 
     133        logger.fatal ("Required at least OpenGL 1.3"); 
     134        setInitFailure; 
     135        return; 
     136    } 
     137    /+try { 
     138        DerelictGL.loadVersions(GLVersion.Version14); 
    132139    } catch (SharedLibProcLoadException e) { 
    133         logger.warn ("Loading OpenGL version 1.3 failed:"); 
     140        logger.warn ("Loading OpenGL version 1.4 failed:"); 
    134141        logger.warn (e.msg); 
    135142         
     
    139146        return; 
    140147        +/ 
    141     } 
     148    }+/ 
    142149     
    143150    // OpenGL stuff: