Changeset 2277
- Timestamp:
- Jan 25, 2013, 4:48:37 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build/autotools/common.am
r1981 r2277 62 62 $(lolfx_gen) 63 63 $(AM_V_at)(echo "char const *"; \ 64 echo "lolfx_ $(notdir $(basename $(filter %.lolfx, $^))) ="; \64 echo "lolfx_resource_$(notdir $(basename $(filter %.lolfx, $^))) ="; \ 65 65 $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \ 66 66 echo ";") \ -
trunk/src/core.h
r2276 r2277 61 61 } 62 62 #endif 63 64 /* External declaration for LolFx files. */ 65 #define LOLFX_RESOURCE_DECLARE(name) \ 66 extern "C" char const *LOLFX_RESOURCE_NAME(name) 67 #define LOLFX_RESOURCE_NAME(name) lolfx_resource_##name 63 68 64 69 /* If using NaCl or Android, override main() with our version */ -
trunk/src/easymesh/easymesh.cpp
r2232 r2277 36 36 #include "easymesh/easymesh-compiler.h" 37 37 38 extern char const *lolfx_shiny;38 LOLFX_RESOURCE_DECLARE(shiny); 39 39 40 40 namespace lol … … 67 67 if(provided_shader == NULL) 68 68 { 69 m_gpu.shader = Shader::Create( lolfx_shiny);69 m_gpu.shader = Shader::Create(LOLFX_RESOURCE_NAME(shiny)); 70 70 } 71 71 else -
trunk/src/gradient.cpp
r2216 r2277 18 18 using namespace std; 19 19 20 extern char const *lolfx_gradient;20 LOLFX_RESOURCE_DECLARE(gradient); 21 21 22 22 namespace lol … … 77 77 if (!data->shader) 78 78 { 79 data->shader = Shader::Create( lolfx_gradient);79 data->shader = Shader::Create(LOLFX_RESOURCE_NAME(gradient)); 80 80 81 81 data->m_vbo = new VertexBuffer(sizeof(vertex)); -
trunk/src/scene.cpp
r2216 r2277 23 23 #include "lolgl.h" 24 24 25 extern char const *lolfx_tile;25 LOLFX_RESOURCE_DECLARE(tile); 26 26 27 27 namespace lol … … 157 157 158 158 if (!data->m_shader) 159 data->m_shader = Shader::Create( lolfx_tile);159 data->m_shader = Shader::Create(LOLFX_RESOURCE_NAME(tile)); 160 160 161 161 #if 0 -
trunk/tools/neercs/video/render.cpp
r2182 r2277 33 33 #include "text-render.h" 34 34 35 extern char const *lolfx_simple;36 extern char const *lolfx_blurh;37 extern char const *lolfx_blurv;38 extern char const *lolfx_glow;39 extern char const *lolfx_remanence;40 extern char const *lolfx_copper;41 extern char const *lolfx_color;42 extern char const *lolfx_noise;43 extern char const *lolfx_postfx;44 extern char const *lolfx_mirror;45 extern char const *lolfx_radial;35 LOLFX_RESOURCE_DECLARE(simple); 36 LOLFX_RESOURCE_DECLARE(blurh); 37 LOLFX_RESOURCE_DECLARE(blurv); 38 LOLFX_RESOURCE_DECLARE(glow); 39 LOLFX_RESOURCE_DECLARE(remanence); 40 LOLFX_RESOURCE_DECLARE(copper); 41 LOLFX_RESOURCE_DECLARE(color); 42 LOLFX_RESOURCE_DECLARE(noise); 43 LOLFX_RESOURCE_DECLARE(postfx); 44 LOLFX_RESOURCE_DECLARE(mirror); 45 LOLFX_RESOURCE_DECLARE(radial); 46 46 47 47 #define PID M_PI/180.0f // pi ratio … … 883 883 fbo_tmp = new FrameBuffer(screen_size); 884 884 // shader simple 885 shader_simple = Shader::Create( lolfx_simple);885 shader_simple = Shader::Create(LOLFX_RESOURCE_NAME(simple)); 886 886 shader_simple_texture = shader_simple->GetUniformLocation("texture"); 887 887 // shader glow 888 shader_glow = Shader::Create( lolfx_glow);888 shader_glow = Shader::Create(LOLFX_RESOURCE_NAME(glow)); 889 889 shader_glow_glow = shader_glow->GetUniformLocation("glow"); 890 890 shader_glow_source = shader_glow->GetUniformLocation("source"); 891 891 shader_glow_mix = shader_glow->GetUniformLocation("mix"); 892 892 // shader blur horizontal 893 shader_blur_h = Shader::Create( lolfx_blurh);893 shader_blur_h = Shader::Create(LOLFX_RESOURCE_NAME(blurh)); 894 894 shader_blur_h_texture = shader_blur_h->GetUniformLocation("texture"); 895 895 shader_blur_h_radius = shader_blur_h->GetUniformLocation("radius"); 896 896 // shader blur vertical 897 shader_blur_v = Shader::Create( lolfx_blurv);897 shader_blur_v = Shader::Create(LOLFX_RESOURCE_NAME(blurv)); 898 898 shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture"); 899 899 shader_blur_v_radius = shader_blur_v->GetUniformLocation("radius"); 900 900 // shader remanence 901 shader_remanence = Shader::Create( lolfx_remanence);901 shader_remanence = Shader::Create(LOLFX_RESOURCE_NAME(remanence)); 902 902 shader_remanence_source = shader_remanence->GetUniformLocation("source"); 903 903 shader_remanence_buffer = shader_remanence->GetUniformLocation("buffer"); 904 904 shader_remanence_mix = shader_remanence->GetUniformLocation("mix"); 905 905 // shader copper 906 shader_copper = Shader::Create( lolfx_copper);906 shader_copper = Shader::Create(LOLFX_RESOURCE_NAME(copper)); 907 907 shader_copper_texture = shader_copper->GetUniformLocation("texture"); 908 908 shader_copper_screen_size = shader_copper->GetUniformLocation("screen_size"); … … 911 911 shader_copper_mask_color = shader_copper->GetUniformLocation("mask_color"); 912 912 // shader color 913 shader_color = Shader::Create( lolfx_color);913 shader_color = Shader::Create(LOLFX_RESOURCE_NAME(color)); 914 914 shader_color_texture = shader_color->GetUniformLocation("texture"); 915 915 shader_color_screen_size = shader_color->GetUniformLocation("screen_size"); … … 918 918 shader_color_flash = shader_color->GetUniformLocation("flash"); 919 919 // shader noise 920 shader_noise = Shader::Create( lolfx_noise);920 shader_noise = Shader::Create(LOLFX_RESOURCE_NAME(noise)); 921 921 shader_noise_texture = shader_noise->GetUniformLocation("texture"); 922 922 shader_noise_screen_size = shader_noise->GetUniformLocation("screen_size"); … … 926 926 shader_noise_retrace = shader_noise->GetUniformLocation("retrace"); 927 927 // shader postfx 928 shader_postfx = Shader::Create( lolfx_postfx);928 shader_postfx = Shader::Create(LOLFX_RESOURCE_NAME(postfx)); 929 929 shader_postfx_texture = shader_postfx->GetUniformLocation("texture"); 930 930 shader_postfx_texture_2d = shader_postfx->GetUniformLocation("texture_2d"); … … 948 948 shader_postfx_beat = shader_postfx->GetUniformLocation("beat"); 949 949 // shader mirror 950 shader_mirror = Shader::Create( lolfx_mirror);950 shader_mirror = Shader::Create(LOLFX_RESOURCE_NAME(mirror)); 951 951 shader_mirror_texture = shader_mirror->GetUniformLocation("texture"); 952 952 shader_mirror_screen_size = shader_mirror->GetUniformLocation("screen_size"); 953 953 shader_mirror_mirror = shader_mirror->GetUniformLocation("mirror"); 954 954 // shader radial blur 955 shader_radial = Shader::Create( lolfx_radial);955 shader_radial = Shader::Create(LOLFX_RESOURCE_NAME(radial)); 956 956 shader_radial_texture = shader_radial->GetUniformLocation("texture"); 957 957 shader_radial_screen_size = shader_radial->GetUniformLocation("screen_size"); -
trunk/tools/neercs/video/text-render.cpp
r2242 r2277 23 23 #include "text-render.h" 24 24 25 extern char const *lolfx_text;25 LOLFX_RESOURCE_DECLARE(text); 26 26 27 27 #define HAVE_SHADER_4 1 … … 47 47 ivec2(256, 256), ivec2(1)); 48 48 49 m_shader = Shader::Create( lolfx_text);49 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(text)); 50 50 m_color = m_shader->GetAttribLocation("in_Attr", 51 51 VertexUsage::Color, 0); -
trunk/tutorial/01_triangle.cpp
r2241 r2277 19 19 using namespace lol; 20 20 21 extern char const *lolfx_01_triangle;21 LOLFX_RESOURCE_DECLARE(01_triangle); 22 22 23 23 class Triangle : public WorldEntity … … 38 38 if (!m_ready) 39 39 { 40 m_shader = Shader::Create( lolfx_01_triangle);40 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(01_triangle)); 41 41 m_coord = m_shader->GetAttribLocation("in_Position", VertexUsage::Position, 0); 42 42 -
trunk/tutorial/02_cube.cpp
r2241 r2277 19 19 using namespace lol; 20 20 21 extern char const *lolfx_02_cube;21 LOLFX_RESOURCE_DECLARE(02_cube); 22 22 23 23 class Cube : public WorldEntity … … 75 75 if (!m_ready) 76 76 { 77 m_shader = Shader::Create( lolfx_02_cube);77 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(02_cube)); 78 78 79 79 m_mvp = m_shader->GetUniformLocation("in_Matrix"); -
trunk/tutorial/03_noise.cpp
r2241 r2277 19 19 using namespace lol; 20 20 21 extern char const *lolfx_03_noise;21 LOLFX_RESOURCE_DECLARE(03_noise); 22 22 23 23 class NoiseDemo : public WorldEntity … … 45 45 if (!m_ready) 46 46 { 47 m_shader = Shader::Create( lolfx_03_noise);47 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(03_noise)); 48 48 m_coord = m_shader->GetAttribLocation("in_Position", VertexUsage::Position, 0); 49 49 m_time_uni = m_shader->GetUniformLocation("u_Time"); -
trunk/tutorial/04_texture.cpp
r2237 r2277 21 21 static int const TEXTURE_WIDTH = 256; 22 22 23 extern char const *lolfx_04_texture;23 LOLFX_RESOURCE_DECLARE(04_texture); 24 24 25 25 class TextureDemo : public WorldEntity … … 75 75 m_texture = new Texture(ivec2(TEXTURE_WIDTH, 1), PixelFormat::A8R8G8B8); 76 76 77 m_shader = Shader::Create( lolfx_04_texture);77 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(04_texture)); 78 78 m_coord = m_shader->GetAttribLocation("in_Position", VertexUsage::Position, 0); 79 79 -
trunk/tutorial/08_fbo.cpp
r2241 r2277 19 19 using namespace lol; 20 20 21 extern char const *lolfx_08_fbo;21 LOLFX_RESOURCE_DECLARE(08_fbo); 22 22 23 23 class FBO : public WorldEntity … … 57 57 if (!m_ready) 58 58 { 59 m_shader = Shader::Create( lolfx_08_fbo);59 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(08_fbo)); 60 60 m_coord = m_shader->GetAttribLocation("in_Position", VertexUsage::Position, 0); 61 61 m_uni_flag = m_shader->GetUniformLocation("in_Flag"); -
trunk/tutorial/11_fractal.cpp
r2241 r2277 21 21 using namespace lol; 22 22 23 extern char const *lolfx_11_fractal;23 LOLFX_RESOURCE_DECLARE(11_fractal); 24 24 25 25 class Fractal : public WorldEntity … … 449 449 m_texture->SetData(&m_pixels[0]); 450 450 451 m_shader = Shader::Create( lolfx_11_fractal);451 m_shader = Shader::Create(LOLFX_RESOURCE_NAME(11_fractal)); 452 452 453 453 m_vertexattrib = m_shader->GetAttribLocation("a_Vertex", VertexUsage::Position, 0);
Note: See TracChangeset
for help on using the changeset viewer.