1 /* 2 *------------------------------------------------------------ 3 * Copyright(c) 2009-2010 by Digital Media Professionals Inc. 4 * All rights reserved. 5 *------------------------------------------------------------ 6 * This source code is the confidential and proprietary 7 * of Digital Media Professionals Inc. 8 *------------------------------------------------------------ 9 */ 10 11 #ifndef DMP_LOADER_H_ 12 #define DMP_LOADER_H_ 13 14 typedef struct tga_dat_header_t 15 { 16 unsigned obj_num; 17 unsigned patch_num; 18 unsigned vtx_size; // total byte size 19 unsigned nrm_size; 20 unsigned tex_size; 21 unsigned tgt_size; 22 unsigned wgt_size; 23 unsigned idx_size; 24 unsigned elm_size; 25 } dat_header_t; 26 27 typedef struct tag_dat_obj_t 28 { 29 unsigned vtx_offset; 30 unsigned vtx_size; // byte size 31 unsigned nrm_offset; 32 unsigned nrm_size; 33 unsigned tex_offset; 34 unsigned tex_size; 35 unsigned tgt_offset; 36 unsigned tgt_size; 37 unsigned wgt_offset; 38 unsigned wgt_size; 39 unsigned idx_offset; 40 unsigned idx_size; 41 unsigned elm_offset; 42 unsigned elm_size; 43 unsigned patch_offset; 44 unsigned patch_size; 45 } dat_obj_t; 46 47 typedef struct tag_dat_patch_t 48 { 49 unsigned elm_offset; 50 unsigned elm_size; 51 GLfloat ambient[3]; 52 GLfloat specular[3]; 53 GLfloat diffuse[3]; 54 GLfloat shininess; 55 } dat_patch_t; 56 57 typedef struct tag_dat_t 58 { 59 GLuint posVB; 60 GLuint normVB; 61 GLuint texVB; 62 GLuint tangVB; 63 GLuint wghtVB; 64 GLuint midxVB; 65 GLuint idxVB; 66 dat_obj_t* obj; 67 dat_patch_t* patch; 68 int obj_num; 69 } dat_t; 70 71 // Load texture from file 72 void loadDAT(const char* name, dat_t* dat); 73 void unloadDAT(dat_t* dat); 74 75 #endif /* _LOADER_H_ */ 76