mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Added support for GLSL 3 shaders (GLSL 3.30 and GLSL ES 3.00).
To use GLSL 3 in a shader, the first line of the shader has to be: #pragma language glsl3 glsl1 is the default language. Added “glsl3” graphics feature as part of the table returned by love.graphics.getSupported(). Added love.graphics.validateShader(boolean gles, shadercode). It returns a boolean along with an error string if the shader code has errors for its target language and platform (gles or desktop). Implemented support for Core Profile OpenGL 3.3 in love.graphics. --HG-- branch : minor
This commit is contained in:
@@ -26,54 +26,10 @@ namespace love
|
||||
namespace graphics
|
||||
{
|
||||
|
||||
StreamBuffer::StreamBuffer(Mode mode, size_t size)
|
||||
: data(nullptr)
|
||||
, offset(0)
|
||||
, totalSize(size)
|
||||
StreamBuffer::StreamBuffer(BufferType mode, size_t size)
|
||||
: bufferSize(size)
|
||||
, mode(mode)
|
||||
{
|
||||
setSize(size);
|
||||
}
|
||||
|
||||
StreamBuffer::~StreamBuffer()
|
||||
{
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
void *StreamBuffer::getData() const
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
void *StreamBuffer::getOffsetData() const
|
||||
{
|
||||
return data + offset;
|
||||
}
|
||||
|
||||
void StreamBuffer::incrementOffset(size_t amount)
|
||||
{
|
||||
offset += amount;
|
||||
}
|
||||
|
||||
void StreamBuffer::resetOffset()
|
||||
{
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
void StreamBuffer::setSize(size_t size)
|
||||
{
|
||||
delete[] data;
|
||||
|
||||
try
|
||||
{
|
||||
data = new uint8[size];
|
||||
}
|
||||
catch (std::exception &)
|
||||
{
|
||||
throw love::Exception("Out of memory.");
|
||||
}
|
||||
|
||||
this->totalSize = size;
|
||||
}
|
||||
|
||||
} // graphics
|
||||
|
||||
Reference in New Issue
Block a user