mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Replace internal C++ newImage and newCanvas methods with newTexture
This commit is contained in:
@@ -130,14 +130,12 @@ love::graphics::StreamBuffer *Graphics::newStreamBuffer(BufferType type, size_t
|
||||
return CreateStreamBuffer(type, size);
|
||||
}
|
||||
|
||||
love::graphics::Texture *Graphics::newImage(const Texture::Settings &settings, const Texture::Slices *data)
|
||||
love::graphics::Texture *Graphics::newTexture(const Texture::Settings &settings, const Texture::Slices *data)
|
||||
{
|
||||
return new Image(settings, data);
|
||||
}
|
||||
|
||||
love::graphics::Texture *Graphics::newCanvas(const Texture::Settings &settings)
|
||||
{
|
||||
return new Canvas(settings);
|
||||
if (settings.renderTarget)
|
||||
return new Canvas(settings);
|
||||
else
|
||||
return new Image(settings, data);
|
||||
}
|
||||
|
||||
love::graphics::ShaderStage *Graphics::newShaderStageInternal(ShaderStage::StageType stage, const std::string &cachekey, const std::string &source, bool gles)
|
||||
|
||||
@@ -60,8 +60,7 @@ public:
|
||||
// Implements Module.
|
||||
const char *getName() const override;
|
||||
|
||||
love::graphics::Texture *newImage(const Texture::Settings &settings, const Texture::Slices *data) override;
|
||||
love::graphics::Texture *newCanvas(const Texture::Settings &settings) override;
|
||||
love::graphics::Texture *newTexture(const Texture::Settings &settings, const Texture::Slices *data = nullptr) override;
|
||||
love::graphics::Buffer *newBuffer(size_t size, const void *data, BufferType type, vertex::Usage usage, uint32 mapflags) override;
|
||||
|
||||
void setViewportSize(int width, int height, int pixelwidth, int pixelheight) override;
|
||||
|
||||
Reference in New Issue
Block a user