1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
enum textures{
TEXTURE_CROSSHAIR,
TEXTURE_LOGO,
TEXTURE_DIRT,
TEXTURE_GRASS_SIDE,
TEXTURE_GRASS,
TEXTURE_STONE};
void client::loadTexts() {
//First crosshair
textureList[TEXTURE_CROSSHAIR] = SOIL_load_OGL_texture(
"resource/art/UI/crosshair.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y | SOIL_FLAG_MULTIPLY_ALPHA
);
textureList[TEXTURE_LOGO] = SOIL_load_OGL_texture
(
"resource/art/UI/logo.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y | SOIL_FLAG_MULTIPLY_ALPHA | SOIL_FLAG_POWER_OF_TWO
);
textureList[TEXTURE_DIRT] = SOIL_load_OGL_texture
(
"resource/art/blocks/terrain/dirt.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_TEXTURE_REPEATS
);
textureList[TEXTURE_GRASS_SIDE] = SOIL_load_OGL_texture
(
"resource/art/blocks/terrain/grassblockside.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_TEXTURE_REPEATS | SOIL_FLAG_INVERT_Y
);
textureList[TEXTURE_GRASS] = SOIL_load_OGL_texture
(
"resource/art/blocks/terrain/grass.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_TEXTURE_REPEATS
);
if(!textureList[TEXTURE_CROSSHAIR] || !textureList[TEXTURE_LOGO] || !textureList[TEXTURE_DIRT])
{
cout<<"TEXTURE LOAD FAILIURE: "<<SOIL_last_result()<<endl;
system("PAUSE");
exit(0);
}
cubeTexture = new cubeLayout;
cubeTexture->UP = textureList[TEXTURE_GRASS];
cubeTexture->DOWN = textureList[TEXTURE_DIRT];
cubeTexture->LEFT = textureList[TEXTURE_GRASS_SIDE];
cubeTexture->RIGHT = textureList[TEXTURE_GRASS_SIDE];
cubeTexture->FRONT = textureList[TEXTURE_GRASS_SIDE];
cubeTexture->BACK = textureList[TEXTURE_GRASS_SIDE];
}
|