Changeset 1459


Ignore:
Timestamp:
Jun 12, 2012, 12:52:00 AM (8 years ago)
Author:
sam
Message:

neercs: some refactoring.

Location:
trunk
Files:
1 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/neercs/video/blurh.lolfx

    r1456 r1459  
    1414
    1515uniform sampler2D texture;
    16 uniform float screen_w;
    17 uniform float screen_h;
     16uniform vec2 screen_size;
    1817uniform float time;
    1918uniform float value;
     
    2423        {
    2524        vec4 total=vec4(0.0);
    26         vec2 p=gl_TexCoord[0].xy/vec2(screen_w,screen_h);
     25        vec2 p=gl_TexCoord[0].xy/screen_size;
    2726        total+=texture2D(texture,vec2(p.x-blur*4.0,p.y))*0.04;
    2827        total+=texture2D(texture,vec2(p.x-blur*3.0,p.y))*0.08;
  • trunk/neercs/video/blurv.lolfx

    r1456 r1459  
    1414
    1515uniform sampler2D texture;
    16 uniform float screen_w;
    17 uniform float screen_h;
     16uniform vec2 screen_size;
    1817uniform float time;
    1918uniform float value;
     
    2423        {
    2524        vec4 total=vec4(0.0);
    26         vec2 p=gl_TexCoord[0].xy/vec2(screen_w,screen_h);
     25        vec2 p=gl_TexCoord[0].xy/screen_size;
    2726        total+=texture2D(texture,vec2(p.x,p.y-blur*4.0))*0.04;
    2827        total+=texture2D(texture,vec2(p.x,p.y-blur*3.0))*0.08;
  • trunk/neercs/video/glow.lolfx

    r1456 r1459  
    1515uniform sampler2D texture;
    1616uniform sampler2D texture_prv;
    17 uniform int screen_w;
    18 uniform int screen_h;
     17uniform vec2 screen_size;
    1918uniform float time;
    2019uniform float step;
  • trunk/neercs/video/postfx.lolfx

    r1456 r1459  
    1414
    1515uniform sampler2D texture;
    16 uniform int screen_w;
    17 uniform int screen_h;
     16uniform vec2 screen_size;
    1817uniform float time;
    1918uniform float flash;
     
    5453        float rnd1=rand(vec2(p.x+time,p.y-time));
    5554        float rnd2=rand(vec2(p.x-time,p.y+time));
    56         float d1=rnd1*value/float(screen_w);
    57         float d2=rnd2*value/float(screen_h);
     55        float d1=rnd1*value/float(screen_size.x);
     56        float d2=rnd2*value/float(screen_size.y);
    5857
    5958        vec3 source;//=get_color(texture,z);
     
    6564        vec3 glass2=get_color(texture,z2);
    6665
    67         float v=value/float(screen_w)*g;
     66        float v=value/float(screen_size.x)*g;
    6867
    6968        vec3 noise;
     
    7978                color-=0.0125*mod(z.y*4.0+time*0.25,1.0);                                                               // electron beam
    8079                color-=(vec3(rnd1,rnd1,rnd1)-vec3(rnd2,rnd2,rnd2))*0.1;                                 // noise
    81                 color*=0.75+0.25*sin(z.x*float(screen_w*2));                                                    // scanline w
    82                 color*=0.90+0.10*cos(z.y*float(screen_h))*sin(0.5+z.x*float(screen_w)); // scanline h
     80                color*=0.75+0.25*sin(z.x*float(screen_size.x*2));                                                       // scanline w
     81                color*=0.90+0.10*cos(z.y*float(screen_size.y))*sin(0.5+z.x*float(screen_size.x));       // scanline h
    8382                }
    8483        else
  • trunk/neercs/video/radial.lolfx

    r1456 r1459  
    1414
    1515uniform sampler2D texture;
    16 uniform int screen_w;
    17 uniform int screen_h;
     16uniform vec2 screen_size;
    1817uniform float time;
    1918uniform float value1;
  • trunk/neercs/video/render.cpp

    r1458 r1459  
    3939
    4040#define WIN32_LEAN_AND_MEAN
    41 #define DEBUG 1           // debug flag //#if defined(_DEBUG)
    42 #define SHADER 1          // shader flag
    43 #define PI 3.1415926535f  // pi
    44 #define PID PI/180.0f     // pi ratio
    45 #define CR 1.0f/256.0f    // color ratio
    46 
    47 bool done=false;
     41#define DEBUG 1            // debug flag //#if defined(_DEBUG)
     42#define SHADER 1           // shader flag
     43#define PI 3.1415926535f   // pi
     44#define PID PI/180.0f      // pi ratio
     45#define CR 1.0f/256.0f     // color ratio
     46
     47bool done = false;
    4848
    4949Timer *timer;
     
    5252
    5353int keys[256];             // keyboard array
    54 int active=true;           // window active flag
    55 bool fullscreen=DEBUG?false:true;    // fullscreen flag
    56 bool pause=false;          // pause flag
    57 float nearplane=0.1f;      // nearplane
    58 float farplane=1000.0f;    // farplane
    59 bool polygon=true;         // polygon mode
    60 int polygon_fillmode=GL_FILL; // fill mode
    61 int ratio_2d=4;            // 2d ratio
     54int active = true;         // window active flag
     55bool fullscreen = DEBUG?false:true;    // fullscreen flag
     56bool pause = false;        // pause flag
     57float nearplane = 0.1f;    // nearplane
     58float farplane = 1000.0f;  // farplane
     59bool polygon = true;       // polygon mode
     60int polygon_fillmode = GL_FILL; // fill mode
     61int ratio_2d = 4;          // 2d ratio
    6262/* window variable */
    63 int base_w=800;            // base width
    64 int base_h=600;            // base height
    65 int window_w=base_w;       // width
    66 int window_h=base_h;       // height
    67 int screen_w;              // screen width
    68 int screen_h;              // screen height
    69 int window_color=32;       // color depth
     63int base_w = 800;          // base width
     64int base_h = 600;          // base height
     65int window_w = base_w;     // width
     66int window_h = base_h;     // height
     67ivec2 screen_size;         // screen size
     68int window_color = 32;     // color depth
    7069float screen_r;            // color red
    7170float screen_g;            // color green
     
    7776/* liner variable */
    7877int car;                   // ascii code
    79 int car_cursor=126;        // cursor ascii code
     78int car_cursor = 126;      // cursor ascii code
    8079int liner_length;          // text length
    8180int liner_line_n;          // line number
     
    8584int liner_count;           // counter
    8685/* text variable */
    87 char *name="cacaShell";
     86char *name = "cacaShell";
    8887std::string txt("");
    8988/* fs_quad variable */
    90 float fs_quad_vtx[]={-1.0f, 1.0f, 0, 1.0f, -1.0f, -1.0f, 0, 1.0f, 1.0f, -1.0f, 0, 1.0f, 1.0f, 1.0f, 0, 1.0f};
    91 float fs_quad_tex[]={0, 1.0f, 0, 0, 1.0f, 0, 1.0f, 1.0f};
     89float fs_quad_vtx[] = {-1.0f, 1.0f, 0, 1.0f, -1.0f, -1.0f, 0, 1.0f, 1.0f, -1.0f, 0, 1.0f, 1.0f, 1.0f, 0, 1.0f};
     90float fs_quad_tex[] = {0, 1.0f, 0, 0, 1.0f, 0, 1.0f, 1.0f};
    9291/* flash variable */
    93 bool flash_flag=false;     // flag
    94 float flash_angle=0;       // angle
    95 float flash_value=0;       // value
     92bool flash_flag = false;   // flag
     93float flash_angle = 0;     // angle
     94float flash_value = 0;     // value
    9695float flash_speed;         // speed
    9796/* fade variable */
    98 bool fade_flag=false;      // flag
    99 float fade_angle=0;        // angle
    100 float fade_value=0;        // value
     97bool fade_flag = false;    // flag
     98float fade_angle = 0;      // angle
     99float fade_value = 0;      // value
    101100float fade_speed;          // speed
    102101/* debug variable */
    103 bool debug_flag=false;     // flag
     102bool debug_flag = false;   // flag
    104103int debug_x;               // position x
    105104int debug_y;               // position y
     
    108107int debug_vtx[8];          // vertex array
    109108/* sync variable */
    110 bool sync_flag=false;      // flag
    111 float sync_angle=0;        // angle
    112 float sync_value=0;        // value
     109bool sync_flag = false;    // flag
     110float sync_angle = 0;      // angle
     111float sync_value = 0;      // value
    113112float sync_speed;          // speed
    114113/* beat variable */
    115 bool beat_flag=false;      // flag
    116 float beat_angle=0;        // angle
    117 float beat_value=0;        // value
     114bool beat_flag = false;    // flag
     115float beat_angle = 0;      // angle
     116float beat_value = 0;      // value
    118117float beat_speed;          // speed
    119118/* corner variable */
    120 const int corner_n=10;     // polygon number
    121 int corner_w=24;           // radius
     119const int corner_n = 10;   // polygon number
     120int corner_w = 24;         // radius
    122121int corner_vtx[corner_n*6];// vertex array
    123122/* dos variable */
    124 bool dos_flag=false;       // flag
     123bool dos_flag = false;     // flag
    125124int dos_w;                 // width
    126125int dos_h;                 // height
     
    131130int dos_vtx[8];            // vertex array
    132131int shell_vtx[8];          // vertex array
    133 float shell_tex[]={1.0f, 0.96875f, 1.0f, 1.0f, 0.78125f, 1.0f, 0.78125f, 0.96875f};
     132float shell_tex[] = {1.0f, 0.96875f, 1.0f, 1.0f, 0.78125f, 1.0f, 0.78125f, 0.96875f};
    134133/* keyboard variable */
    135 int key_code=0;            // keyboard code
     134int key_code = 0;          // keyboard code
    136135/* common variable */
    137136int i, j, k, l;
     
    141140TileSet *tex_map;
    142141/* shader variable */
    143 bool shader_flag=SHADER?true:false;
    144 bool shader_blur_flag=SHADER?true:false;
    145 bool shader_effect_flag=SHADER?true:false;
    146 bool shader_glow_flag=true;
    147 int glow_fbo_size=2;       // glow fbo size
    148 int glow_color;            // 0=color/1=alpha
     142bool shader_flag = SHADER?true:false;
     143bool shader_blur_flag = SHADER?true:false;
     144bool shader_effect_flag = SHADER?true:false;
     145bool shader_glow_flag = true;
     146int glow_fbo_size = 2;     // glow fbo size
     147int glow_color;            // 0 = color/1 = alpha
    149148float glow_smoothstep;     // glow smoothstep value
    150149float glow_mix_ratio1;     // glow mixing ratio
    151150float glow_mix_ratio2;     // source mixing ratio
    152 bool shader_radial_flag=false;
     151bool shader_radial_flag = false;
    153152float radial_value1;
    154153float radial_value2;
    155154float radial_color;        // color
    156 bool shader_postfx_flag=SHADER?true:false;
    157 bool postfx_scanline=true;
     155bool shader_postfx_flag = SHADER?true:false;
     156bool postfx_scanline = true;
    158157float postfx_deform;       // deformation ratio
    159158#if SHADER
    160 Shader* shader_simple;
    161 Shader* shader_blur_h;
    162 Shader* shader_blur_v;
    163 Shader* shader_glow;
    164 Shader* shader_radial;
    165 Shader* shader_postfx;
     159Shader *shader_simple, *shader_blur_h, *shader_blur_v;
     160Shader *shader_glow, *shader_radial, *shader_postfx;
    166161// shader variables
    167162ShaderUniform shader_simple_texture;
    168 ShaderUniform shader_blur_h_texture;
    169 ShaderUniform shader_blur_h_screen_w;
    170 ShaderUniform shader_blur_h_screen_h;
    171 ShaderUniform shader_blur_h_time;
    172 ShaderUniform shader_blur_h_value;
    173 ShaderUniform shader_blur_v_texture;
    174 ShaderUniform shader_blur_v_screen_w;
    175 ShaderUniform shader_blur_v_screen_h;
    176 ShaderUniform shader_blur_v_time;
    177 ShaderUniform shader_blur_v_value;
    178 ShaderUniform shader_glow_texture;
    179 ShaderUniform shader_glow_texture_prv;
    180 ShaderUniform shader_glow_screen_w;
    181 ShaderUniform shader_glow_screen_h;
    182 ShaderUniform shader_glow_time;
    183 ShaderUniform shader_glow_step;
    184 ShaderUniform shader_glow_value1;
    185 ShaderUniform shader_glow_value2;
    186 ShaderUniform shader_radial_texture;
    187 ShaderUniform shader_radial_screen_w;
    188 ShaderUniform shader_radial_screen_h;
    189 ShaderUniform shader_radial_time;
    190 ShaderUniform shader_radial_value1;
    191 ShaderUniform shader_radial_value2;
    192 ShaderUniform shader_radial_color;
    193 ShaderUniform shader_postfx_texture;
    194 ShaderUniform shader_postfx_texture_2d;
    195 ShaderUniform shader_postfx_screen_w;
    196 ShaderUniform shader_postfx_screen_h;
    197 ShaderUniform shader_postfx_time;
    198 ShaderUniform shader_postfx_flash;
    199 ShaderUniform shader_postfx_value;
    200 ShaderUniform shader_postfx_deform;
    201 ShaderUniform shader_postfx_scanline;
    202 ShaderUniform shader_postfx_sync;
    203 
    204 FrameBuffer *fbo_back;
    205 FrameBuffer *fbo_front;
    206 FrameBuffer *fbo_blur_h;
    207 FrameBuffer *fbo_blur_v;
    208 FrameBuffer *fbo_ping;
    209 FrameBuffer *fbo_pong;
     163ShaderUniform shader_blur_h_texture,
     164              shader_blur_h_screen_size,
     165              shader_blur_h_time,
     166              shader_blur_h_value;
     167ShaderUniform shader_blur_v_texture,
     168              shader_blur_v_screen_size,
     169              shader_blur_v_time,
     170              shader_blur_v_value;
     171ShaderUniform shader_glow_texture,
     172              shader_glow_texture_prv,
     173              shader_glow_screen_size,
     174              shader_glow_time,
     175              shader_glow_step,
     176              shader_glow_value1,
     177              shader_glow_value2;
     178ShaderUniform shader_radial_texture,
     179              shader_radial_screen_size,
     180              shader_radial_time,
     181              shader_radial_value1,
     182              shader_radial_value2,
     183              shader_radial_color;
     184ShaderUniform shader_postfx_texture,
     185              shader_postfx_texture_2d,
     186              shader_postfx_screen_size,
     187              shader_postfx_time,
     188              shader_postfx_flash,
     189              shader_postfx_value,
     190              shader_postfx_deform,
     191              shader_postfx_scanline,
     192              shader_postfx_sync;
     193
     194FrameBuffer *fbo_back, *fbo_front, *fbo_blur_h, *fbo_blur_v;
     195FrameBuffer *fbo_ping, *fbo_pong;
    210196#endif
    211197
    212198void init_viewport(int type)
    213199{
    214     glViewport(0, 0, screen_w, screen_h);
     200    glViewport(0, 0, screen_size.x, screen_size.y);
    215201    glMatrixMode(GL_PROJECTION);
    216202    glLoadIdentity();
    217     mat4 proj = (type == 0) ? mat4::perspective(70, (float)(float)screen_w, (float)screen_h, nearplane, farplane) : mat4::ortho(0, screen_w, screen_h, 0);
     203    mat4 proj = (type == 0) ? mat4::perspective(70, (float)screen_size.x, (float)screen_size.y, nearplane, farplane) : mat4::ortho(0, screen_size.x, screen_size.y, 0);
    218204    glLoadMatrixf(&proj[0][0]);
    219205    glMatrixMode(GL_MODELVIEW);
     
    245231void calc_txt()
    246232{
    247     liner_length=txt.length();
    248     liner_count=0;
    249     liner_line_n=0;
    250     liner_max=0;
    251     liner_i=0;
    252     for(i=0;i<liner_length;i++)
    253     {
    254         if((unsigned char)txt[i]!=13)
     233    liner_length = txt.length();
     234    liner_count = 0;
     235    liner_line_n = 0;
     236    liner_max = 0;
     237    liner_i = 0;
     238    for(i = 0;i<liner_length;i++)
     239    {
     240        if((unsigned char)txt[i] != 13)
    255241        {
    256242            liner_i++;
     
    258244        else
    259245        {
    260             if(liner_i>liner_max) liner_max=liner_i;
     246            if(liner_i>liner_max) liner_max = liner_i;
    261247            liner_line_n++;
    262             liner_i=0;
    263         }
    264     }
    265     if(liner_i>liner_max) liner_max=liner_i;
    266 }
    267 
    268 void flash()
    269 {
    270     flash_flag=true;
    271     flash_angle=main_angle;
    272 }
    273 
    274 void fade()
    275 {
    276     fade_flag=true;
    277     fade_angle=main_angle;
    278 }
    279 
    280 void sync()
    281 {
    282     sync_flag=true;
    283     sync_angle=main_angle;
    284 }
    285 
    286 void beat()
    287 {
    288     beat_flag=true;
    289     beat_angle=main_angle;
     248            liner_i = 0;
     249        }
     250    }
     251    if(liner_i>liner_max) liner_max = liner_i;
    290252}
    291253
     
    304266{
    305267    float vertex[2+corner_n*2];
    306     vertex[0]=0;
    307     vertex[1]=0;
    308     for(i=1;i<corner_n+1;i++)
    309     {
    310         j=i*2;
    311         float a=PID*90.0f/(corner_n-1)*(i-1);
    312         vertex[j  ]=corner_w-corner_w*cosf(a);
    313         vertex[j+1]=corner_w-corner_w*sinf(a);
    314     }
    315     for(i=0;i<corner_n;i++)
    316     {
    317         j=i*6;
    318         k=i*2;
    319         corner_vtx[j  ]=(int)vertex[0];
    320         corner_vtx[j+1]=(int)vertex[1];
    321         corner_vtx[j+2]=(int)vertex[2+k];
    322         corner_vtx[j+3]=(int)vertex[3+k];
    323         corner_vtx[j+4]=(int)vertex[4+k];
    324         corner_vtx[j+5]=(int)vertex[5+k];
     268    vertex[0] = 0;
     269    vertex[1] = 0;
     270    for(i = 1;i<corner_n+1;i++)
     271    {
     272        j = i*2;
     273        float a = PID*90.0f/(corner_n-1)*(i-1);
     274        vertex[j  ] = corner_w-corner_w*cosf(a);
     275        vertex[j+1] = corner_w-corner_w*sinf(a);
     276    }
     277    for(i = 0;i<corner_n;i++)
     278    {
     279        j = i*6;
     280        k = i*2;
     281        corner_vtx[j  ] = (int)vertex[0];
     282        corner_vtx[j+1] = (int)vertex[1];
     283        corner_vtx[j+2] = (int)vertex[2+k];
     284        corner_vtx[j+3] = (int)vertex[3+k];
     285        corner_vtx[j+4] = (int)vertex[4+k];
     286        corner_vtx[j+5] = (int)vertex[5+k];
    325287    }
    326288}
     
    328290void screen()
    329291{
    330     part_angle=main_angle;
    331     dos_flag=true;
    332     dos_r=CR*48;
    333     dos_g=CR*56;
    334     dos_b=CR*64;
    335     screen_r=dos_r;
    336     screen_g=dos_g;
    337     screen_b=dos_b;
    338     txt="\rCopyright \x05e 2012 cacaShell v0.1\r ";
     292    part_angle = main_angle;
     293    dos_flag = true;
     294    dos_r = CR*48;
     295    dos_g = CR*56;
     296    dos_b = CR*64;
     297    screen_r = dos_r;
     298    screen_g = dos_g;
     299    screen_b = dos_b;
     300    txt = "\rCopyright \x05e 2012 cacaShell v0.1\r ";
    339301    calc_txt();
    340302    /*-------------------------*/
    341     shader_effect_flag=true;
    342     shader_glow_flag=true;
    343     glow_color=1;
    344     glow_smoothstep=0;//.025f;
    345     glow_mix_ratio1=0.5f;
    346     glow_mix_ratio2=0.5f;
    347     shader_radial_flag=false;
    348     radial_value1=2.0f;
    349     radial_value2=0.8f;
    350     radial_color=0;
    351     postfx_deform=0.5f;
     303    shader_effect_flag = true;
     304    shader_glow_flag = true;
     305    glow_color = 1;
     306    glow_smoothstep = 0;//.025f;
     307    glow_mix_ratio1 = 0.5f;
     308    glow_mix_ratio2 = 0.5f;
     309    shader_radial_flag = false;
     310    radial_value1 = 2.0f;
     311    radial_value2 = 0.8f;
     312    radial_color = 0;
     313    postfx_deform = 0.5f;
    352314    /*-------------------------*/
    353     flash_speed=1.5f;
    354     fade_speed=0.2f;
    355     sync_flag=false;
    356     sync_value=1.0f;
    357     sync_speed=1.0f;
    358     beat_speed=2.0f;
     315    flash_speed = 1.5f;
     316    fade_speed = 0.2f;
     317    sync_flag = false;
     318    sync_value = 1.0f;
     319    sync_speed = 1.0f;
     320    beat_speed = 2.0f;
    359321    /*-------------------------*/
    360322    glClearColor(screen_r, screen_g, screen_b, 1.0f);
     
    370332    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    371333    // load texture
    372      tex_map=new TileSet("neercs/video/resource/map.bmp", ivec2(256, 256), ivec2(1));
     334    tex_map = new TileSet("neercs/video/resource/map.png", ivec2(256, 256), ivec2(1));
    373335    // initialize some variable
    374     timer=new Timer();
     336    timer = new Timer();
    375337    screen();
    376338    /*-PATACODE----------------------------------------------------------------*/
    377     #if SHADER
    378     if(shader_flag)
    379     {
    380             fbo_back=new FrameBuffer(ivec2(screen_w, screen_h));
    381             fbo_front=new FrameBuffer(ivec2(screen_w, screen_h));
    382             fbo_blur_h=new FrameBuffer(ivec2(screen_w/glow_fbo_size, screen_h/glow_fbo_size));
    383             fbo_blur_v=new FrameBuffer(ivec2(screen_w/glow_fbo_size, screen_h/glow_fbo_size));
    384             fbo_ping=new FrameBuffer(ivec2(screen_w, screen_h));
    385             fbo_pong=new FrameBuffer(ivec2(screen_w, screen_h));
    386             // shader simple
    387             shader_simple=Shader::Create(lolfx_simple);
    388             shader_simple_texture=shader_simple->GetUniformLocation("texture");
    389             // shader blur horizontal
    390             shader_blur_h=Shader::Create(lolfx_blurh);
    391             shader_blur_h_texture=shader_blur_h->GetUniformLocation("texture");
    392             shader_blur_h_screen_w=shader_blur_h->GetUniformLocation("screen_w");
    393             shader_blur_h_screen_h=shader_blur_h->GetUniformLocation("screen_h");
    394             shader_blur_h_time=shader_blur_h->GetUniformLocation("time");
    395             shader_blur_h_value=shader_blur_h->GetUniformLocation("value");
    396             // shader blur vertical
    397             shader_blur_v=Shader::Create(lolfx_blurv);
    398             shader_blur_v_texture=shader_blur_v->GetUniformLocation("texture");
    399             shader_blur_v_screen_w=shader_blur_v->GetUniformLocation("screen_w");
    400             shader_blur_v_screen_h=shader_blur_v->GetUniformLocation("screen_h");
    401             shader_blur_v_time=shader_blur_v->GetUniformLocation("time");
    402             shader_blur_v_value=shader_blur_v->GetUniformLocation("value");
    403             // shader glow
    404             shader_glow=Shader::Create(lolfx_glow);
    405             shader_glow_texture=shader_glow->GetUniformLocation("texture");
    406             shader_glow_texture_prv=shader_glow->GetUniformLocation("texture_prv");
    407             shader_glow_screen_w=shader_glow->GetUniformLocation("screen_w");
    408             shader_glow_screen_h=shader_glow->GetUniformLocation("screen_h");
    409             shader_glow_time=shader_glow->GetUniformLocation("time");
    410             shader_glow_step=shader_glow->GetUniformLocation("step");
    411             shader_glow_value1=shader_glow->GetUniformLocation("value1");
    412             shader_glow_value2=shader_glow->GetUniformLocation("value2");
    413             // shader radial
    414             shader_radial=Shader::Create(lolfx_radial);
    415             shader_radial_texture=shader_radial->GetUniformLocation("texture");
    416             shader_radial_screen_w=shader_radial->GetUniformLocation("screen_w");
    417             shader_radial_screen_h=shader_radial->GetUniformLocation("screen_h");
    418             shader_radial_time=shader_radial->GetUniformLocation("time");
    419             shader_radial_value1=shader_radial->GetUniformLocation("value1");
    420             shader_radial_value2=shader_radial->GetUniformLocation("value2");
    421             shader_radial_color=shader_radial->GetUniformLocation("color");
    422             // shader postfx
    423             shader_postfx=Shader::Create(lolfx_postfx);
    424             shader_postfx_texture=shader_postfx->GetUniformLocation("texture");
    425             shader_postfx_texture_2d=shader_postfx->GetUniformLocation("texture_2d");
    426             shader_postfx_screen_w=shader_postfx->GetUniformLocation("screen_w");
    427             shader_postfx_screen_h=shader_postfx->GetUniformLocation("screen_h");
    428             shader_postfx_time=shader_postfx->GetUniformLocation("time");
    429             shader_postfx_flash=shader_postfx->GetUniformLocation("flash");
    430             shader_postfx_value=shader_postfx->GetUniformLocation("value");
    431             shader_postfx_deform=shader_postfx->GetUniformLocation("deform");
    432             shader_postfx_scanline=shader_postfx->GetUniformLocation("scanline");
    433             shader_postfx_sync=shader_postfx->GetUniformLocation("sync");
    434         }
    435     #endif
     339#if SHADER
     340    if (shader_flag)
     341    {
     342        fbo_back = new FrameBuffer(screen_size);
     343        fbo_front = new FrameBuffer(screen_size);
     344        fbo_blur_h = new FrameBuffer(screen_size / glow_fbo_size);
     345        fbo_blur_v = new FrameBuffer(screen_size / glow_fbo_size);
     346        fbo_ping = new FrameBuffer(screen_size);
     347        fbo_pong = new FrameBuffer(screen_size);
     348        // shader simple
     349        shader_simple = Shader::Create(lolfx_simple);
     350        shader_simple_texture = shader_simple->GetUniformLocation("texture");
     351        // shader blur horizontal
     352        shader_blur_h = Shader::Create(lolfx_blurh);
     353        shader_blur_h_texture = shader_blur_h->GetUniformLocation("texture");
     354        shader_blur_h_screen_size = shader_blur_h->GetUniformLocation("screen_size");
     355        shader_blur_h_time = shader_blur_h->GetUniformLocation("time");
     356        shader_blur_h_value = shader_blur_h->GetUniformLocation("value");
     357        // shader blur vertical
     358        shader_blur_v = Shader::Create(lolfx_blurv);
     359        shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture");
     360        shader_blur_v_screen_size = shader_blur_v->GetUniformLocation("screen_size");
     361        shader_blur_v_time = shader_blur_v->GetUniformLocation("time");
     362        shader_blur_v_value = shader_blur_v->GetUniformLocation("value");
     363        // shader glow
     364        shader_glow = Shader::Create(lolfx_glow);
     365        shader_glow_texture = shader_glow->GetUniformLocation("texture");
     366        shader_glow_texture_prv = shader_glow->GetUniformLocation("texture_prv");
     367        shader_glow_screen_size = shader_glow->GetUniformLocation("screen_size");
     368        shader_glow_time = shader_glow->GetUniformLocation("time");
     369        shader_glow_step = shader_glow->GetUniformLocation("step");
     370        shader_glow_value1 = shader_glow->GetUniformLocation("value1");
     371        shader_glow_value2 = shader_glow->GetUniformLocation("value2");
     372        // shader radial
     373        shader_radial = Shader::Create(lolfx_radial);
     374        shader_radial_texture = shader_radial->GetUniformLocation("texture");
     375        shader_radial_screen_size = shader_radial->GetUniformLocation("screen_size");
     376        shader_radial_time = shader_radial->GetUniformLocation("time");
     377        shader_radial_value1 = shader_radial->GetUniformLocation("value1");
     378        shader_radial_value2 = shader_radial->GetUniformLocation("value2");
     379        shader_radial_color = shader_radial->GetUniformLocation("color");
     380        // shader postfx
     381        shader_postfx = Shader::Create(lolfx_postfx);
     382        shader_postfx_texture = shader_postfx->GetUniformLocation("texture");
     383        shader_postfx_texture_2d = shader_postfx->GetUniformLocation("texture_2d");
     384        shader_postfx_screen_size = shader_postfx->GetUniformLocation("screen_size");
     385        shader_postfx_time = shader_postfx->GetUniformLocation("time");
     386        shader_postfx_flash = shader_postfx->GetUniformLocation("flash");
     387        shader_postfx_value = shader_postfx->GetUniformLocation("value");
     388        shader_postfx_deform = shader_postfx->GetUniformLocation("deform");
     389        shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline");
     390        shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
     391    }
     392#endif
    436393    /*-/PATACODE---------------------------------------------------------------*/
    437394    return true;
    438395}
    439396
    440 int DrawGLScene(void) // draw scene
    441 {
     397int CreateGLWindow(char* title)
     398{
     399    screen_size = Video::GetSize();
     400    //ratio_2d = (int)(screen_size.x/400); if(ratio_2d<2) ratio_2d = 2;
     401    corner_w = 16*ratio_2d;
     402    corner();
     403    dos_w = 2*ratio_2d;
     404    dos_h = 4*ratio_2d;
     405    dos_m = 12*ratio_2d;
     406    dos_vtx[0] = dos_w;
     407    dos_vtx[1] = dos_h;
     408    dos_vtx[2] = dos_w;
     409    dos_vtx[3] = -dos_h;
     410    dos_vtx[4] = -dos_w;
     411    dos_vtx[5] = -dos_h;
     412    dos_vtx[6] = -dos_w;
     413    dos_vtx[7] = dos_h;
     414    shell_vtx[0] = dos_m+29*ratio_2d;
     415    shell_vtx[1] = dos_m+9*ratio_2d;
     416    shell_vtx[2] = dos_m+29*ratio_2d;
     417    shell_vtx[3] = dos_m+1*ratio_2d;
     418    shell_vtx[4] = dos_m+1*ratio_2d;
     419    shell_vtx[5] = dos_m+1*ratio_2d;
     420    shell_vtx[6] = dos_m+1*ratio_2d;
     421    shell_vtx[7] = dos_m+9*ratio_2d;
     422    debug_w = 5*ratio_2d;
     423    debug_h = 5*ratio_2d;
     424    debug_x = 10*ratio_2d;
     425    debug_y = 28*ratio_2d;
     426    debug_vtx[0] = debug_w;
     427    debug_vtx[1] = debug_h;
     428    debug_vtx[2] = debug_w;
     429    debug_vtx[3] = -debug_h;
     430    debug_vtx[4] = -debug_w;
     431    debug_vtx[5] = -debug_h;
     432    debug_vtx[6] = -debug_w;
     433    debug_vtx[7] = debug_h;
     434    InitGL();
     435    return true;
     436}
     437
     438Render::Render()
     439{
     440}
     441
     442void Render::TickGame(float seconds)
     443{
     444    Entity::TickGame(seconds);
     445}
     446
     447void Render::TickDraw(float seconds)
     448{
     449    Entity::TickDraw(seconds);
     450
     451    static int todo = 1;
     452    if (todo)
     453    {
     454        CreateGLWindow("LOL");
     455        todo = 0;
     456    }
     457
    442458    // timer
    443     if(!pause) main_angle += timer->Get() * 100.0f * PID;
     459    if(!pause)
     460        main_angle += timer->Get() * 100.0f * PID;
    444461    if(sync_flag)
    445462    {
     
    514531        glDisable(GL_BLEND);
    515532        glColor3f(1.0f, 1.0f, 1.0f);
    516         rectangle(dos_m, dos_m, screen_w-(int)(26.5f*ratio_2d)-dos_m*2, 10*ratio_2d);
    517         rectangle(screen_w-(int)(25.5f*ratio_2d)-dos_m, dos_m, 11*ratio_2d, 10*ratio_2d);
    518         rectangle(screen_w-(int)(13.5f*ratio_2d)-dos_m, dos_m, 11*ratio_2d, 10*ratio_2d);
    519         rectangle(screen_w-(int)(1.5f*ratio_2d)-dos_m, dos_m, (int)(1.5f*ratio_2d), 10*ratio_2d);
    520         rectangle(dos_m, dos_m+10*ratio_2d, 1*ratio_2d, screen_h-10*ratio_2d-dos_m*2);
    521         rectangle(screen_w-1*ratio_2d-dos_m, dos_m+10*ratio_2d, 1*ratio_2d, screen_h-10*ratio_2d-dos_m*2);
    522         rectangle(dos_m+1*ratio_2d, screen_h-1*ratio_2d-dos_m, screen_w-2*ratio_2d-dos_m*2, 1*ratio_2d);
     533        rectangle(dos_m, dos_m, screen_size.x-(int)(26.5f*ratio_2d)-dos_m*2, 10*ratio_2d);
     534        rectangle(screen_size.x-(int)(25.5f*ratio_2d)-dos_m, dos_m, 11*ratio_2d, 10*ratio_2d);
     535        rectangle(screen_size.x-(int)(13.5f*ratio_2d)-dos_m, dos_m, 11*ratio_2d, 10*ratio_2d);
     536        rectangle(screen_size.x-(int)(1.5f*ratio_2d)-dos_m, dos_m, (int)(1.5f*ratio_2d), 10*ratio_2d);
     537        rectangle(dos_m, dos_m+10*ratio_2d, 1*ratio_2d, screen_size.y-10*ratio_2d-dos_m*2);
     538        rectangle(screen_size.x-1*ratio_2d-dos_m, dos_m+10*ratio_2d, 1*ratio_2d, screen_size.y-10*ratio_2d-dos_m*2);
     539        rectangle(dos_m+1*ratio_2d, screen_size.y-1*ratio_2d-dos_m, screen_size.x-2*ratio_2d-dos_m*2, 1*ratio_2d);
    523540        glColor3f(dos_r, dos_g, dos_b);
    524541        rectangle(dos_m+1*ratio_2d, dos_m+1*ratio_2d, 28*ratio_2d, 8*ratio_2d);
    525         rectangle(dos_m+(int)(30.5f*ratio_2d), dos_m+2*ratio_2d, screen_w-(int)(58.5f*ratio_2d)-dos_m*2, 2*ratio_2d);
    526         rectangle(dos_m+(int)(30.5f*ratio_2d), dos_m+6*ratio_2d, screen_w-(int)(58.5f*ratio_2d)-dos_m*2, 2*ratio_2d);
    527         rectangle(screen_w-(int)(24.5f*ratio_2d)-dos_m, dos_m+1*ratio_2d, 7*ratio_2d, 6*ratio_2d);
     542        rectangle(dos_m+(int)(30.5f*ratio_2d), dos_m+2*ratio_2d, screen_size.x-(int)(58.5f*ratio_2d)-dos_m*2, 2*ratio_2d);
     543        rectangle(dos_m+(int)(30.5f*ratio_2d), dos_m+6*ratio_2d, screen_size.x-(int)(58.5f*ratio_2d)-dos_m*2, 2*ratio_2d);
     544        rectangle(screen_size.x-(int)(24.5f*ratio_2d)-dos_m, dos_m+1*ratio_2d, 7*ratio_2d, 6*ratio_2d);
    528545        glColor3f(1.0f, 1.0f, 1.0f);
    529         rectangle(screen_w-(int)(23.5f*ratio_2d)-dos_m, dos_m+2*ratio_2d, 5*ratio_2d, 4*ratio_2d);
     546        rectangle(screen_size.x-(int)(23.5f*ratio_2d)-dos_m, dos_m+2*ratio_2d, 5*ratio_2d, 4*ratio_2d);
    530547        glColor3f(0, 0, 0);
    531         rectangle(screen_w-(int)(22.5f*ratio_2d)-dos_m, dos_m+3*ratio_2d, 7*ratio_2d, 6*ratio_2d);
    532         rectangle(screen_w-(int)(12.5f*ratio_2d)-dos_m, dos_m+1*ratio_2d, 7*ratio_2d, 6*ratio_2d);
     548        rectangle(screen_size.x-(int)(22.5f*ratio_2d)-dos_m, dos_m+3*ratio_2d, 7*ratio_2d, 6*ratio_2d);
     549        rectangle(screen_size.x-(int)(12.5f*ratio_2d)-dos_m, dos_m+1*ratio_2d, 7*ratio_2d, 6*ratio_2d);
    533550        glColor3f(dos_r, dos_g, dos_b);
    534         rectangle(screen_w-(int)(10.5f*ratio_2d)-dos_m, dos_m+2*ratio_2d, 7*ratio_2d, 7*ratio_2d);
     551        rectangle(screen_size.x-(int)(10.5f*ratio_2d)-dos_m, dos_m+2*ratio_2d, 7*ratio_2d, 7*ratio_2d);
    535552        glColor3f(1.0f, 1.0f, 1.0f);
    536         rectangle(screen_w-(int)(9.5f*ratio_2d)-dos_m, dos_m+3*ratio_2d, 5*ratio_2d, 5*ratio_2d);
    537         rectangle(screen_w-8*ratio_2d-dos_m, screen_h-9*ratio_2d-dos_m, 7*ratio_2d, 8*ratio_2d);
     553        rectangle(screen_size.x-(int)(9.5f*ratio_2d)-dos_m, dos_m+3*ratio_2d, 5*ratio_2d, 5*ratio_2d);
     554        rectangle(screen_size.x-8*ratio_2d-dos_m, screen_size.y-9*ratio_2d-dos_m, 7*ratio_2d, 8*ratio_2d);
    538555        glColor3f(dos_r, dos_g, dos_b);
    539         rectangle(screen_w-7*ratio_2d-dos_m, screen_h-8*ratio_2d-dos_m, 6*ratio_2d, 7*ratio_2d);
     556        rectangle(screen_size.x-7*ratio_2d-dos_m, screen_size.y-8*ratio_2d-dos_m, 6*ratio_2d, 7*ratio_2d);
    540557        glColor3f(1.0f, 1.0f, 1.0f);
    541         rectangle(screen_w-4*ratio_2d-dos_m, screen_h-8*ratio_2d-dos_m, 4*ratio_2d, 2*ratio_2d);
    542         rectangle(screen_w-7*ratio_2d-dos_m, screen_h-5*ratio_2d-dos_m, 2*ratio_2d, 5*ratio_2d);
    543         rectangle(screen_w-6*ratio_2d-dos_m, screen_h-7*ratio_2d-dos_m, 1*ratio_2d, 1*ratio_2d);
    544         rectangle(screen_w-4*ratio_2d-dos_m, screen_h-5*ratio_2d-dos_m, 2*ratio_2d, 3*ratio_2d);
     558        rectangle(screen_size.x-4*ratio_2d-dos_m, screen_size.y-8*ratio_2d-dos_m, 4*ratio_2d, 2*ratio_2d);
     559        rectangle(screen_size.x-7*ratio_2d-dos_m, screen_size.y-5*ratio_2d-dos_m, 2*ratio_2d, 5*ratio_2d);
     560        rectangle(screen_size.x-6*ratio_2d-dos_m, screen_size.y-7*ratio_2d-dos_m, 1*ratio_2d, 1*ratio_2d);
     561        rectangle(screen_size.x-4*ratio_2d-dos_m, screen_size.y-5*ratio_2d-dos_m, 2*ratio_2d, 3*ratio_2d);
    545562        glEnable(GL_BLEND);
    546563        if(polygon) glEnable(GL_TEXTURE_2D);
     
    576593                x=dos_m;
    577594                y=dos_m+(float)(15*ratio_2d+liner_line*(dos_h+4*ratio_2d));
    578                 if(y+dos_h>screen_h-dos_m) break;
     595                if(y+dos_h>screen_size.y-dos_m) break;
    579596            }
    580597        }
     
    585602    {
    586603        char debug[512];
    587         sprintf(debug, "width=%d\rheight=%d\rratio=%dx\rbeat=%-02.1f\rsync=%-02.1f\rkey code=%03d\r", screen_w, screen_h, ratio_2d, beat_value, sync_value, key_code);
     604        sprintf(debug, "width=%d\rheight=%d\rratio=%dx\rbeat=%-02.1f\rsync=%-02.1f\rkey code=%03d\r", screen_size.x, screen_size.y, ratio_2d, beat_value, sync_value, key_code);
    588605        float l_v=0.0390625f;
    589606        float l_j=0.001953125f;
     
    622639    glColor3f(0, 0, 0);
    623640    glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    624     glTranslated(screen_w, 0, 0);
     641    glTranslated(screen_size.x, 0, 0);
    625642    glRotated(90.0f, 0, 0, 1.0f);
    626643    glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    627     glTranslated(screen_h, 0, 0);
     644    glTranslated(screen_size.y, 0, 0);
    628645    glRotated(90.0f, 0, 0, 1.0f);
    629646    glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
    630     glTranslated(screen_w, 0, 0);
     647    glTranslated(screen_size.x, 0, 0);
    631648    glRotated(90.0f, 0, 0, 1.0f);
    632649    glDrawArrays(GL_TRIANGLES, 0, corner_n*3);
     
    638655    /*-PATACODE----------------------------------------------------------------*/
    639656    #if SHADER
    640     if(shader_flag)
     657    if (shader_flag)
    641658    {
    642659        init_shader();
    643660        fbo_back->Unbind();
    644         if(shader_effect_flag&&shader_blur_flag)
     661        if (shader_effect_flag && shader_blur_flag)
    645662        {
    646663            // shader blur horizontal
     
    648665            shader_blur_h->Bind();
    649666            shader_blur_h->SetTexture(shader_blur_h_texture, fbo_back->GetTexture(), 0);
    650             shader_blur_h->SetUniform(shader_blur_h_screen_w, 1.0f);
    651             shader_blur_h->SetUniform(shader_blur_h_screen_h, 1.0f);
     667            shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f));
    652668            shader_blur_h->SetUniform(shader_blur_h_time, fx_angle);
    653             shader_blur_h->SetUniform(shader_blur_h_value, 0.5f/screen_w);
     669            shader_blur_h->SetUniform(shader_blur_h_value, 0.5f/screen_size.x);
    654670            fs_quad();
    655671            shader_blur_h->Unbind();
     
    659675            shader_blur_v->Bind();
    660676            shader_blur_v->SetTexture(shader_blur_v_texture, fbo_ping->GetTexture(), 0);
    661             shader_blur_v->SetUniform(shader_blur_v_screen_w, 1.0f);
    662             shader_blur_v->SetUniform(shader_blur_v_screen_h, 1.0f);
     677            shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f));
    663678            shader_blur_v->SetUniform(shader_blur_v_time, fx_angle);
    664             shader_blur_v->SetUniform(shader_blur_v_value, 0.5f/screen_h);
     679            shader_blur_v->SetUniform(shader_blur_v_value, 0.5f/screen_size.y);
    665680            fs_quad();
    666681            shader_blur_v->Unbind();
     
    680695            shader_blur_h->Bind();
    681696            shader_blur_h->SetTexture(shader_blur_h_texture, fbo_ping->GetTexture(), 0);
    682             shader_blur_h->SetUniform(shader_blur_h_screen_w, 1.0f/glow_fbo_size);
    683             shader_blur_h->SetUniform(shader_blur_h_screen_h, 1.0f/glow_fbo_size);
     697            shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size));
    684698            shader_blur_h->SetUniform(shader_blur_h_time, fx_angle);
    685             shader_blur_h->SetUniform(shader_blur_h_value, 2.5f/screen_w);
     699            shader_blur_h->SetUniform(shader_blur_h_value, 2.5f/screen_size.x);
    686700            fs_quad();
    687701            shader_blur_h->Unbind();
     
    691705            shader_blur_v->Bind();
    692706            shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
    693             shader_blur_v->SetUniform(shader_blur_v_screen_w, 1.0f/glow_fbo_size);
    694             shader_blur_v->SetUniform(shader_blur_v_screen_h, 1.0f/glow_fbo_size);
     707            shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size));
    695708            shader_blur_v->SetUniform(shader_blur_v_time, fx_angle);
    696             shader_blur_v->SetUniform(shader_blur_h_value, 2.5f/screen_h);
     709            shader_blur_v->SetUniform(shader_blur_h_value, 2.5f/screen_size.y);
    697710            fs_quad();
    698711            shader_blur_v->Unbind();
     
    702715            shader_blur_h->Bind();
    703716            shader_blur_h->SetTexture(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0);
    704             shader_blur_h->SetUniform(shader_blur_h_screen_w, 1.0f/glow_fbo_size);
    705             shader_blur_h->SetUniform(shader_blur_h_screen_h, 1.0f/glow_fbo_size);
     717            shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size));
    706718            shader_blur_h->SetUniform(shader_blur_h_time, fx_angle);
    707             shader_blur_h->SetUniform(shader_blur_h_value, 1.0f/screen_w);
     719            shader_blur_h->SetUniform(shader_blur_h_value, 1.0f/screen_size.x);
    708720            fs_quad();
    709721            shader_blur_h->Unbind();
     
    713725            shader_blur_v->Bind();
    714726            shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
    715             shader_blur_v->SetUniform(shader_blur_v_screen_w, 1.0f/glow_fbo_size);
    716             shader_blur_v->SetUniform(shader_blur_v_screen_h, 1.0f/glow_fbo_size);
     727            shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size));
    717728            shader_blur_v->SetUniform(shader_blur_v_time, fx_angle);
    718             shader_blur_v->SetUniform(shader_blur_h_value, 1.0f/screen_h);
     729            shader_blur_v->SetUniform(shader_blur_h_value, 1.0f/screen_size.y);
    719730            fs_quad();
    720731            shader_blur_v->Unbind();
     
    725736            shader_glow->SetTexture(shader_glow_texture, fbo_blur_v->GetTexture(), 0);
    726737            shader_glow->SetTexture(shader_glow_texture_prv, fbo_front->GetTexture(), 1);
    727             shader_glow->SetUniform(shader_glow_screen_w, 1.0f);
    728             shader_glow->SetUniform(shader_glow_screen_h, 1.0f);
     738            shader_glow->SetUniform(shader_glow_screen_size, vec2(1.0f));
    729739            shader_glow->SetUniform(shader_glow_time, fx_angle);
    730740            shader_glow->SetUniform(shader_glow_step, glow_smoothstep);
     
    746756            shader_postfx->Bind();
    747757            shader_postfx->SetTexture(shader_postfx_texture, fbo_pong->GetTexture(), 0);
    748             shader_postfx->SetUniform(shader_postfx_screen_w, screen_w);
    749             shader_postfx->SetUniform(shader_postfx_screen_h, screen_h);
     758            shader_postfx->SetUniform(shader_postfx_screen_size, (vec2)screen_size);
    750759            shader_postfx->SetUniform(shader_postfx_time, fx_angle);
    751760            shader_postfx->SetUniform(shader_postfx_flash, flash_value);
     
    765774    #endif
    766775    /*-/PATACODE---------------------------------------------------------------*/
    767     return true;
    768 }
    769 
    770 int CreateGLWindow(char* title)
    771 {
    772     GLuint pixelFormat;    // pixel format result
    773     uint32_t dwExStyle;        // window extended style
    774     uint32_t dwStyle;            // window style
    775     screen_w=Video::GetSize().x;
    776     screen_h=Video::GetSize().y;
    777     //ratio_2d=(int)(screen_w/400); if(ratio_2d<2) ratio_2d=2;
    778     corner_w=16*ratio_2d;
    779     corner();
    780     dos_w=2*ratio_2d;
    781     dos_h=4*ratio_2d;
    782     dos_m=12*ratio_2d;
    783     dos_vtx[0]=dos_w;
    784     dos_vtx[1]=dos_h;
    785     dos_vtx[2]=dos_w;
    786     dos_vtx[3]=-dos_h;
    787     dos_vtx[4]=-dos_w;
    788     dos_vtx[5]=-dos_h;
    789     dos_vtx[6]=-dos_w;
    790     dos_vtx[7]=dos_h;
    791     shell_vtx[0]=dos_m+29*ratio_2d;
    792     shell_vtx[1]=dos_m+9*ratio_2d;
    793     shell_vtx[2]=dos_m+29*ratio_2d;
    794     shell_vtx[3]=dos_m+1*ratio_2d;
    795     shell_vtx[4]=dos_m+1*ratio_2d;
    796     shell_vtx[5]=dos_m+1*ratio_2d;
    797     shell_vtx[6]=dos_m+1*ratio_2d;
    798     shell_vtx[7]=dos_m+9*ratio_2d;
    799     debug_w=5*ratio_2d;
    800     debug_h=5*ratio_2d;
    801     debug_x=10*ratio_2d;
    802     debug_y=28*ratio_2d;
    803     debug_vtx[0]=debug_w;
    804     debug_vtx[1]=debug_h;
    805     debug_vtx[2]=debug_w;
    806     debug_vtx[3]=-debug_h;
    807     debug_vtx[4]=-debug_w;
    808     debug_vtx[5]=-debug_h;
    809     debug_vtx[6]=-debug_w;
    810     debug_vtx[7]=debug_h;
    811     InitGL();
    812     return true;
    813 }
    814 
    815 Render::Render()
    816 {
    817 }
    818 
    819 void Render::TickGame(float seconds)
    820 {
    821     Entity::TickGame(seconds);
    822 }
    823 
    824 void Render::TickDraw(float seconds)
    825 {
    826     Entity::TickDraw(seconds);
    827 
    828     static int todo = 1;
    829     if (todo)
    830     {
    831         CreateGLWindow("LOL");
    832         todo = 0;
    833     }
    834     DrawGLScene();
    835776}
    836777
  • trunk/src/gpu/shader.cpp

    r1452 r1459  
    520520void Shader::SetTexture(ShaderUniform const &uni, int id, int index)
    521521{
    522     if (id == -1)
    523         return;
    524522#if defined USE_D3D9 || defined _XBOX
    525523    /* FIXME: unimplemented */
Note: See TracChangeset for help on using the changeset viewer.