Changeset 304 for trunk/thune/gl

Show
Ignore:
Timestamp:
10/30/06 03:10:11 (2 years ago)
Author:
krobillard
Message:

Thune GL - Shader 'default block implemented.

Location:
trunk/thune/gl
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/gl/gx.c

    r303 r304  
    18511851    FIXED_ATOM( "vertex",   6, UR_ATOM_VERTEX ); 
    18521852    FIXED_ATOM( "fragment", 8, UR_ATOM_FRAGMENT ); 
     1853    FIXED_ATOM( "default",  7, UR_ATOM_DEFAULT ); 
    18531854 
    18541855#if MAKE_ATOM_HEADER 
  • trunk/thune/gl/gx_atoms.h

    r303 r304  
    2121#define UR_ATOM_VERTEX          319 
    2222#define UR_ATOM_FRAGMENT                320 
     23#define UR_ATOM_DEFAULT         321 
  • trunk/thune/gl/gx_dt.c

    r301 r304  
    2121#include "os.h" 
    2222#include "gx.h" 
     23#include "internal.h" 
    2324#include "urlan_atoms.h" 
    2425#include "gx_atoms.h" 
     
    314315    UCell* res = ur_s_prev(tos); 
    315316    UAtom cmd = 0; 
     317    UIndex defN = 0; 
    316318    const char* vprog = 0; 
    317319    const char* fprog = 0; 
     
    338340                            fprog = ur_cstring( it ); 
    339341                        break; 
     342 
     343                    case UT_BLOCK: 
     344                        if( cmd == UR_ATOM_DEFAULT ) 
     345                            defN = it->series.n; 
     346                        break; 
    340347                } 
    341348                ++it; 
     
    346353                if( ! makeShader( ur_thread, res, vprog, fprog ) ) 
    347354                    return; 
     355 
     356                if( ur_is(res, UT_CONTEXT) && defN ) 
     357                { 
     358                    ur_bind( defN, res ); 
     359 
     360                    ur_initType( tos, UT_BLOCK ); 
     361                    ur_setSeries( tos, defN, 0 ); 
     362 
     363                    UR_CALL_OP = OP_DO; 
     364                    return; 
     365                } 
    348366            } 
    349367            else 
  • trunk/thune/gl/test.t

    r303 r304  
    5050;"data/shader/testA.gx" 
    5151    load.shader :test-shader 
    52  
    53 test-shader context! is-type? ift ( 
    54     1.0, 0.3, 0.2 :test-shader/brickcolor 
    55     0.9, 0.85     :test-shader/brickpct 
    56     1.0, 0.5      :test-shader/bricksize 
    57     0.8, 0.8, 0.8 :test-shader/mortarcolor 
    58 ) 
    59 ;test-shader . 
    6052 
    61530,0,0 :strobe