mirror of
https://github.com/love2d/love.git
synced 2026-08-18 19:54:22 +02:00
Potentially fix a crash in love.window.setMode.
--HG-- branch : minor
This commit is contained in:
@@ -755,13 +755,19 @@ protected:
|
|||||||
struct StreamBufferState
|
struct StreamBufferState
|
||||||
{
|
{
|
||||||
StreamBuffer *vb[2];
|
StreamBuffer *vb[2];
|
||||||
StreamBuffer *indexBuffer;
|
StreamBuffer *indexBuffer = nullptr;
|
||||||
vertex::PrimitiveMode primitiveMode;
|
vertex::PrimitiveMode primitiveMode = vertex::PrimitiveMode::TRIANGLES;
|
||||||
vertex::CommonFormat formats[2];
|
vertex::CommonFormat formats[2];
|
||||||
StrongRef<Texture> texture;
|
StrongRef<Texture> texture;
|
||||||
ptrdiff_t textureHandle = 0;
|
ptrdiff_t textureHandle = 0;
|
||||||
int vertexCount;
|
int vertexCount = 0;
|
||||||
int indexCount;
|
int indexCount = 0;
|
||||||
|
|
||||||
|
StreamBufferState()
|
||||||
|
{
|
||||||
|
vb[0] = vb[1] = nullptr;
|
||||||
|
formats[0] = formats[1] = vertex::CommonFormat::NONE;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void restoreState(const DisplayState &s);
|
void restoreState(const DisplayState &s);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ StreamBuffer::StreamBuffer(Mode mode, size_t size)
|
|||||||
|
|
||||||
StreamBuffer::~StreamBuffer()
|
StreamBuffer::~StreamBuffer()
|
||||||
{
|
{
|
||||||
delete[] data;
|
delete[] data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *StreamBuffer::getData() const
|
void *StreamBuffer::getData() const
|
||||||
|
|||||||
Reference in New Issue
Block a user