mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-03 06:24:32 +00:00
sync with icculus repo
This commit is contained in:
parent
5623b11f83
commit
321a65a9fb
2 changed files with 15 additions and 22 deletions
|
@ -803,25 +803,24 @@ bool isTouchingLine(Vector lineStart, Vector lineEnd, Vector point, int radius,
|
|||
GLuint generateEmptyTexture(int quality) // Create An Empty Texture
|
||||
{
|
||||
GLuint txtnumber=0; // Texture ID
|
||||
unsigned int* data; // Stored Data
|
||||
unsigned char *data; // Stored Data
|
||||
|
||||
// Create Storage Space For Texture Data (128x128x4)
|
||||
int size = (quality * quality)* 4;
|
||||
data = (unsigned int*)new GLuint[size];
|
||||
|
||||
memset(data, 0, size * sizeof(GLuint)); // Clear Storage Memory
|
||||
int size = (quality * quality) * 4;
|
||||
data = new unsigned char[size];
|
||||
|
||||
memset(data, 0, size); // Clear Storage Memory
|
||||
|
||||
#ifdef BBGE_BUILD_OPENGL
|
||||
glGenTextures(1, &txtnumber); // Create 1 Texture
|
||||
glBindTexture(GL_TEXTURE_2D, txtnumber); // Bind The Texture
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, 4, quality, quality, 0,
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, quality, quality, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, data); // Build Texture Using Information In data
|
||||
#endif
|
||||
|
||||
delete [] data; // Release data
|
||||
delete [] data; // Release data
|
||||
|
||||
return txtnumber; // Return The Texture ID
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue