Changeset 68 for trunk


Ignore:
Timestamp:
05/31/13 19:31:29 (12 years ago)
Author:
epyon
Message:
  • engine support for int8 vectors (might be removed later?) - types added
  • input_event -> io_event
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/io_event.hh

    r67 r68  
    103103        NV_REGISTER_NAME( system_event );
    104104
    105         struct input_event
     105        struct io_event
    106106        {
    107107                io_event_code type;
     
    114114                };
    115115        };
    116         NV_REGISTER_NAME( input_event );
     116        NV_REGISTER_NAME( io_event );
    117117
    118118        const char* get_key_name( key_code key );
  • trunk/nv/types.hh

    r67 r68  
    3737                INT_VECTOR_2,
    3838                INT_VECTOR_3,
    39                 INT_VECTOR_4
    40         };
     39                INT_VECTOR_4,
     40                // unsupported gl conversion, remove?
     41                BYTE_VECTOR_2,
     42                BYTE_VECTOR_3,
     43                BYTE_VECTOR_4,
     44        };
     45
     46        typedef glm::detail::tvec2<uint8> i8vec2;
     47        typedef glm::detail::tvec3<uint8> i8vec3;
     48        typedef glm::detail::tvec4<uint8> i8vec4;
    4149
    4250        typedef glm::vec2 vec2;
     
    7078        template <> struct enum_to_type< INT_VECTOR_4 > { typedef ivec4 type; };
    7179
     80        template <> struct enum_to_type< BYTE_VECTOR_2 > { typedef i8vec2 type; };
     81        template <> struct enum_to_type< BYTE_VECTOR_3 > { typedef i8vec3 type; };
     82        template <> struct enum_to_type< BYTE_VECTOR_4 > { typedef i8vec4 type; };
     83
    7284        template <> struct enum_to_type< FLOAT_MATRIX_2 > { typedef mat2 type; };
    7385        template <> struct enum_to_type< FLOAT_MATRIX_3 > { typedef mat3 type; };
     
    92104        template <> struct type_to_enum< ivec4 > { static const etype type = INT_VECTOR_4; };
    93105
     106        template <> struct type_to_enum< i8vec2 > { static const etype type = BYTE_VECTOR_2; };
     107        template <> struct type_to_enum< i8vec3 > { static const etype type = BYTE_VECTOR_3; };
     108        template <> struct type_to_enum< i8vec4 > { static const etype type = BYTE_VECTOR_4; };
     109
    94110        template <> struct type_to_enum< mat2 > { static const etype type = FLOAT_MATRIX_2; };
    95111        template <> struct type_to_enum< mat3 > { static const etype type = FLOAT_MATRIX_3; };
     
    125141        template <> inline const char* get_type_name< ivec3 > () { return "ivec3"; }
    126142        template <> inline const char* get_type_name< ivec4 > () { return "ivec4"; }
     143
     144        template <> inline const char* get_type_name< i8vec2 > () { return "i8vec2"; }
     145        template <> inline const char* get_type_name< i8vec3 > () { return "i8vec3"; }
     146        template <> inline const char* get_type_name< i8vec4 > () { return "i8vec4"; }
    127147
    128148        template <> inline const char* get_type_name< mat2 > () { return "mat2"; }
  • trunk/src/gl/gl_enum.cc

    r62 r68  
    205205        case INT_VECTOR_3   : return GL_INT_VEC3;
    206206        case INT_VECTOR_4   : return GL_INT_VEC4;
     207        // remove, error or ?
     208        case BYTE_VECTOR_2  : return GL_INT_VEC2;
     209        case BYTE_VECTOR_3  : return GL_INT_VEC3;
     210        case BYTE_VECTOR_4  : return GL_INT_VEC4;
    207211        default : return 0; // TODO: throw!
    208212        }
Note: See TracChangeset for help on using the changeset viewer.