Updated to love-android changeset 3b5e5e182a00

This commit is contained in:
Martin Felis
2014-01-12 21:21:46 +01:00
parent 0ff0941068
commit 69b200b144
396 changed files with 52558 additions and 2317 deletions
+23 -42
View File
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2013 LOVE Development Team
* Copyright (c) 2006-2014 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,14 +21,11 @@
#ifndef LOVE_GRAPHICS_OPENGL_CANVAS_H
#define LOVE_GRAPHICS_OPENGL_CANVAS_H
#include "graphics/DrawQable.h"
#include "graphics/Volatile.h"
#include "graphics/Image.h"
#include "graphics/Color.h"
#include "image/Image.h"
#include "image/ImageData.h"
#include "common/math.h"
#include "common/Matrix.h"
#include "Texture.h"
#include "OpenGL.h"
namespace love
@@ -38,7 +35,7 @@ namespace graphics
namespace opengl
{
class Canvas : public DrawQable, public Volatile
class Canvas : public Texture
{
public:
@@ -52,6 +49,20 @@ public:
Canvas(int width, int height, TextureType texture_type = TYPE_NORMAL);
virtual ~Canvas();
// Implements Volatile.
virtual bool loadVolatile();
virtual void unloadVolatile();
// Implements Drawable.
virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const;
// Implements Texture.
virtual void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const;
virtual void setFilter(const Texture::Filter &f);
virtual void setWrap(const Texture::Wrap &w);
virtual GLuint getGLTexture() const;
virtual void predraw() const;
/**
* @param canvases A list of other canvases to temporarily attach to this one,
* to allow drawing to multiple canvases at once.
@@ -62,13 +73,6 @@ public:
void clear(Color c);
virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const;
/**
* @copydoc DrawQable::drawq()
**/
void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const;
/**
* Create and attach a stencil buffer to this Canvas' framebuffer, if necessary.
**/
@@ -78,16 +82,10 @@ public:
void getPixel(unsigned char* pixel_rgba, int x, int y);
const std::vector<Canvas *> &getAttachedCanvases() const;
void setFilter(const Image::Filter &f);
Image::Filter getFilter() const;
void setWrap(const Image::Wrap &w);
Image::Wrap getWrap() const;
int getWidth();
int getHeight();
inline const std::vector<Canvas *> &getAttachedCanvases() const
{
return attachedCanvases;
}
inline GLenum getStatus() const
{
@@ -99,9 +97,6 @@ public:
return texture_type;
}
bool loadVolatile();
void unloadVolatile();
static bool isSupported();
static bool isHDRSupported();
static bool isMultiCanvasSupported();
@@ -112,33 +107,19 @@ public:
static Canvas *current;
static void bindDefaultCanvas();
GLuint getTextureName() const
{
return img;
}
// The viewport dimensions of the system (default) framebuffer.
static OpenGL::Viewport systemViewport;
private:
friend class Shader;
GLsizei width;
GLsizei height;
GLuint fbo;
GLuint depth_stencil;
GLuint img;
TextureType texture_type;
Vertex vertices[4];
GLenum status;
struct
{
Image::Filter filter;
Image::Wrap wrap;
} settings;
std::vector<Canvas *> attachedCanvases;
void setupGrab();