Changeset 42
- Timestamp:
- 01/26/07 00:57:02 (2 years ago)
- Files:
-
- trunk/luigi/adapters/gld.d (modified) (1 diff)
- trunk/luigi/example1.brf (deleted)
- trunk/luigi/example1.d (deleted)
- trunk/luigi/example1_gld.brf (deleted)
- trunk/luigi/example1_gld.d (deleted)
- trunk/luigi/example1_sdl.brf (deleted)
- trunk/luigi/example1_sdl.d (deleted)
- trunk/luigi/example1d.brf (deleted)
- trunk/luigi/examples (added)
- trunk/luigi/examples/example1_gld.brf (added)
- trunk/luigi/examples/example1_gld.d (added)
- trunk/luigi/examples/example1_glfw.brf (added)
- trunk/luigi/examples/example1_glfw.d (added)
- trunk/luigi/examples/example1_sdl.brf (added)
- trunk/luigi/examples/example1_sdl.d (added)
- trunk/luigi/examples/example1d_glfw.brf (added)
- trunk/luigi/gui.d (modified) (4 diffs)
- trunk/luigi/themes/dxut.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/luigi/adapters/gld.d
r33 r42 31 31 import luigi.event; 32 32 import luigi.adapter; 33 import gld;33 private import gld; 34 34 //import sslot.signal; 35 35 import luigi.signalobj; trunk/luigi/gui.d
r37 r42 76 76 import std.ctype : isprint; 77 77 import std.uni : isUniAlpha; 78 static import std.path; 79 static import std.file; 78 80 79 81 // Just for debug? 80 82 import std.stdio : writefln; 83 81 84 82 85 /** … … 109 112 } 110 113 114 /// Add a location where themes should look for resource files 115 /// (e.g. images, textures, etc. The built-in themes look for some files 116 /// relative to the luigi base directory, so you may need to add it to 117 /// your path.) The current directory '.' is the only thing on the resource path 118 /// by default. 119 void add_resource_location(char[] path) { 120 char[] workp = path.dup; 121 if (workp[$-1..$] != std.path.sep) { workp ~= std.path.sep; } 122 m_resource_path ~= workp; 123 } 124 /// Get the current resource path. This is a list of paths where Luigi 125 /// should look for resource files like images. 126 char[][] resource_path() { 127 return m_resource_path; 128 } 129 /// Finds the specified resource file on the resource path. This could be 130 /// an image or anything else. Used to find theme textures internally. 131 /// Returns null if the resource could not be located on the resource path. 132 char[] find_resource_location(char[] name) { 133 writefln("Looking for file: ", name); 134 foreach(char[] p; m_resource_path) { 135 char[] fullpath = p ~ name; 136 writefln("Trying file: ", fullpath); 137 if (std.file.exists(fullpath)) { 138 return fullpath; 139 } 140 } 141 return null; 142 } 143 111 144 /** Add a top level overlay. 112 145 This is called automatically by Overlay, so typically there is no … … 145 178 } 146 179 180 181 147 182 private: 148 183 149 184 this() { 185 add_resource_location("."); 150 186 } 151 187 … … 156 192 InputAdapter m_inputsys; 157 193 Theme m_theme; 194 char[][] m_resource_path; 158 195 } 159 196 trunk/luigi/themes/dxut.d
r39 r42 1234 1234 void loadCompressedTexture(char[] filename, inout GLuint texid) 1235 1235 { 1236 DDSImageData *pDDSdata = loadDDSTextureFile( filename ); 1236 char[] filepath = Luigi().find_resource_location(filename); 1237 DDSImageData *pDDSdata = null; 1238 if (filepath) { 1239 pDDSdata = loadDDSTextureFile( filepath ); 1240 } else { 1241 char[] str = std.string.format( 1242 "loadDDSTextureFile couldn't find, or failed to load \"%s\"", filename); 1243 report_error(str); 1244 return; 1245 } 1237 1246 1238 1247 if( pDDSdata )
