Changeset 83:2813ac68576f

Show
Ignore:
Timestamp:
08/30/08 05:54:32 (4 months ago)
Author:
Diggory Hardy <diggory.hardy@gmail.com>
branch:
default
Message:

Start of creating a separate gui demo module and leaving mde.d for testing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mde/font/FontTexture.d

    r63 r83  
    302302            format = (fontOpts.renderMode & RENDER_LCD_BGR) ? GL_BGR : GL_RGB; 
    303303        } else if (b.pixel_mode == FT_Pixel_Mode.FT_PIXEL_MODE_LCD_V) { 
    304             // NOTE: Notes above apply. Only in this case converting the buffers seems essential. 
     304            // NOTE: Notes above apply. But in this case converting the buffers seems essential. 
    305305            buffer = new ubyte[b.width*b.rows]; 
    306306            for (uint i = 0; i < b.rows; ++i) 
     
    457457OptionsFont fontOpts; 
    458458class OptionsFont : Options { 
    459     /* renderMode should be FT_LOAD_TARGET_NORMAL, FT_LOAD_TARGET_LIGHT, FT_LOAD_TARGET_LCD or 
    460      * FT_LOAD_TARGET_LCD_V, possibly with bit 31 set (see RENDER_LCD_BGR). 
    461      * FT_LOAD_TARGET_MONO is unsupported. 
     459    /* renderMode have one of the following values, possibly with bit 31 set (see RENDER_LCD_BGR): 
     460     * FT_LOAD_TARGET_NORMAL    (0x00000) 
     461     * FT_LOAD_TARGET_LIGHT     (0x10000) 
     462     * FT_LOAD_TARGET_LCD       (0x30000) 
     463     * FT_LOAD_TARGET_LCD_V     (0x40000) 
     464     * The mode FT_LOAD_TARGET_MONO (0x20000) is unsupported. 
    462465     * 
    463466     * lcdFilter should come from enum FT_LcdFilter: 
    464      * FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2 */ 
     467     * FT_LCD_FILTER_NONE (0), FT_LCD_FILTER_DEFAULT (1), FT_LCD_FILTER_LIGHT (2) */ 
    465468    mixin (impl!("int renderMode, lcdFilter;")); 
    466469     
  • mde/font/font.d

    r79 r83  
    6969            FT_Int maj, min, patch; 
    7070            FT_Library_Version (library, &maj, &min, &patch); 
    71             if (maj != 2 || min != 3) 
     71            if (maj != 2 || min != 3) { 
    7272                logger.warn ("Using an untested FreeType version: {}.{}.{}", maj, min, patch); 
     73                logger.info ("The only tested version of freetype is 2.3.5"); 
     74            } 
    7375             
    7476            // Set LCD filtering method if LCD rendering is enabled. 
  • mde/mde.d

    r75 r83  
    1616/** Modular D Engine 
    1717 * 
    18  * This module contains main(), which calls Init and runs the main loop. 
     18 * This module contains a minimal main() function. Practically, it is useful for running unittests 
     19 * and some other testing. It also serves as a basic example program. 
    1920 */ 
    2021module mde.mde; 
    2122 
    22 // Comment to show use, where only used minimally: 
    23  
    2423import mde.imde;                        // this module's interface for external modules 
    25 import mde.events;                      // pollEvents 
     24import mde.setup.Init;                  // initialization 
    2625import mde.lookup.Options;              // pollInterval option 
    27  
     26import mde.scheduler.Scheduler;         // mainSchedule 
     27import mde.events;                      // pollEvents() 
    2828import gl = mde.gl.draw;                // gl.draw() 
    29 import mde.input.Input;                 // new Input() 
    30  
    31 import mde.setup.Init; 
    32 import mde.scheduler.Scheduler;         // Scheduler.run() 
    33 import mde.setup.exception;             // InitException 
    3429 
    3530import tango.core.Thread : Thread;  // Thread.sleep() 
     
    3934int main(char[][] args) 
    4035{ 
    41     //BEGIN Initialisation 
    42     Logger logger = Log.getLogger ("mde.mde"); 
     36    // If compiled with unittests, notify that they completed and exit: 
    4337    debug (mdeUnitTest) { 
     38        Logger logger = Log.getLogger ("mde.mde"); 
    4439        logger.info ("Compiled unittests have completed; terminating."); 
    4540        return 0; 
    4641    } 
    4742     
    48     scope Init init; 
    49     try { 
    50         init = new Init(args);  // initialisation 
    51     } catch (InitException e) { 
    52         logger.fatal ("Initialisation failed: " ~ e.msg); 
    53         return 1; 
    54     } 
     43    scope Init init = new Init(args);   // initialize mde 
    5544     
     45    // Make sure pollInterval has a sane value. FIXME: get Options class to enforce range 
    5646    if (miscOpts.pollInterval !<= 1.0 || miscOpts.pollInterval !>= 0.0) 
    5747        miscOpts.set!(double) ("pollInterval", 0.01); 
    58     //END Initialisation 
    5948     
    6049    //BEGIN Main loop setup