mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-16 01:54:38 +02:00
This commit is contained in:
@@ -686,7 +686,7 @@ struct WaterCache {
|
||||
int w, h;
|
||||
getTargetSize(w, h);
|
||||
// get refraction texture
|
||||
if (!refract || w != refract->width || h != refract->height) {
|
||||
if (!refract || w != refract->origWidth || h != refract->origHeight) {
|
||||
delete refract;
|
||||
refract = new Texture(w, h, Texture::RGBA, false);
|
||||
Core::setTarget(refract, CLEAR_ALL);
|
||||
|
33
src/mesh.h
33
src/mesh.h
@@ -102,23 +102,26 @@ struct Mesh {
|
||||
if (Core::support.VAO)
|
||||
glBindVertexArray(Core::active.VAO = 0);
|
||||
|
||||
if (vertices || indices) {
|
||||
glGenBuffers(2, ID);
|
||||
bind(true);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, iCount * sizeof(Index), indices, GL_STATIC_DRAW);
|
||||
glBufferData(GL_ARRAY_BUFFER, vCount * sizeof(VertexGPU), vertices, GL_STATIC_DRAW);
|
||||
|
||||
if (Core::support.VAO && aCount) {
|
||||
VAO = new GLuint[aCount];
|
||||
glGenVertexArrays(aCount, VAO);
|
||||
#ifdef DYNGEOM_NO_VBO
|
||||
if (!vertices && !indices) {
|
||||
ID[0] = ID[1] = 0;
|
||||
iBuffer = new Index[iCount];
|
||||
vBuffer = new VertexGPU[vCount];
|
||||
return;
|
||||
}
|
||||
iBuffer = NULL;
|
||||
vBuffer = NULL;
|
||||
} else {
|
||||
ID[0] = ID[1] = 0;
|
||||
iBuffer = new Index[iCount];
|
||||
vBuffer = new VertexGPU[vCount];
|
||||
#endif
|
||||
|
||||
glGenBuffers(2, ID);
|
||||
bind(true);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, iCount * sizeof(Index), indices, GL_STATIC_DRAW);
|
||||
glBufferData(GL_ARRAY_BUFFER, vCount * sizeof(VertexGPU), vertices, GL_STATIC_DRAW);
|
||||
|
||||
if (Core::support.VAO && aCount) {
|
||||
VAO = new GLuint[aCount];
|
||||
glGenVertexArrays(aCount, VAO);
|
||||
}
|
||||
iBuffer = NULL;
|
||||
vBuffer = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -92,12 +92,15 @@ struct Texture {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
origWidth = width;
|
||||
origHeight = height;
|
||||
|
||||
if (!Core::support.texNPOT) {
|
||||
width = nextPow2(width);
|
||||
height = nextPow2(height);
|
||||
}
|
||||
this->width = origWidth = width;
|
||||
this->height = origHeight = height;
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
|
||||
bool filter = (opt & NEAREST) == 0;
|
||||
bool cube = (opt & CUBEMAP) != 0;
|
||||
|
Reference in New Issue
Block a user