mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 21:11:47 +01:00
Temp commit. Textures not working anymor :(
This commit is contained in:
@@ -216,7 +216,7 @@ void Texture::CreateFromSurface( SDL_Surface* pSurface )
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
}
|
||||
|
||||
void Texture::Draw( const Point2f& dstBottomLeft, const Rectf& srcRect ) const
|
||||
void Texture::Draw( const Point2f& dstBottomLeft, const Rectf& srcRect, bool flip) const
|
||||
{
|
||||
const float epsilon{ 0.001f };
|
||||
if ( !m_CreationOk )
|
||||
@@ -242,7 +242,7 @@ void Texture::Draw( const Point2f& dstBottomLeft, const Rectf& srcRect ) const
|
||||
}
|
||||
}
|
||||
|
||||
void Texture::Draw( const Rectf& dstRect, const Rectf& srcRect ) const
|
||||
void Texture::Draw( const Rectf& dstRect, const Rectf& srcRect, bool flip ) const
|
||||
{
|
||||
const float epsilon{ 0.001f };
|
||||
if ( !m_CreationOk )
|
||||
@@ -296,7 +296,9 @@ void Texture::Draw( const Rectf& dstRect, const Rectf& srcRect ) const
|
||||
{
|
||||
vertexRight = vertexLeft + dstRect.width;
|
||||
vertexTop = vertexBottom + dstRect.height;
|
||||
|
||||
}
|
||||
if(flip) {
|
||||
std::swap(vertexLeft, vertexRight);
|
||||
}
|
||||
|
||||
// Tell opengl which texture we will use
|
||||
|
||||
Reference in New Issue
Block a user