mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
texture mixing
This commit is contained in:
+7
-6
@@ -34,9 +34,10 @@ namespace vb01{
|
||||
}
|
||||
}
|
||||
|
||||
Texture::Texture(string path[], int numPaths, int updateRate, bool flip){
|
||||
Texture::Texture(string path[], int numPaths, TextureTypeId textureTypeId, bool flip){
|
||||
mixRatio = .1;
|
||||
this->typeId = textureTypeId;
|
||||
this->numFrames = numPaths;
|
||||
this->updateRate = updateRate;
|
||||
|
||||
texture = new u32[numPaths];
|
||||
|
||||
@@ -148,10 +149,10 @@ namespace vb01{
|
||||
}
|
||||
|
||||
void Texture::update(int id){
|
||||
updateFrame();
|
||||
//updateFrame();
|
||||
select(id);
|
||||
if(numFrames > 0)
|
||||
select(id + 1);
|
||||
select(id + 1, 1);
|
||||
}
|
||||
|
||||
void Texture::updateFrame(){
|
||||
@@ -163,8 +164,8 @@ namespace vb01{
|
||||
}
|
||||
}
|
||||
|
||||
void Texture::select(int id){
|
||||
void Texture::select(int id, int fr){
|
||||
glActiveTexture(GL_TEXTURE0 + id);
|
||||
glBindTexture(type == TEXTURE_2D ? GL_TEXTURE_2D : GL_TEXTURE_CUBE_MAP, texture[frame]);
|
||||
glBindTexture(type == TEXTURE_2D ? GL_TEXTURE_2D : GL_TEXTURE_CUBE_MAP, texture[fr]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user