Added Mesh objects and love.graphics.newMesh. Mesh objects are similar to Geometry but they're drawables (the relationship between meshes and images is the opposite of geometry and images.)

Removed Geometry objects and re-added Quads.

example:
local vertices = {{0, 0, 0, 0}, {100, 0, 1, 0}, {100, 100, 1, 1}, {0, 100, 0, 1}}
mesh = love.graphics.newMesh(vertices, image, "fan")
..
love.graphics.draw(mesh, 0, 0)

--HG--
branch : Mesh
This commit is contained in:
Alex Szpakowski
2013-09-28 18:26:47 -03:00
parent 5de43a7207
commit 1e696c4505
28 changed files with 1141 additions and 956 deletions
+5 -10
View File
@@ -40,11 +40,12 @@
#include "Font.h"
#include "Image.h"
#include "graphics/Geometry.h"
#include "graphics/Quad.h"
#include "SpriteBatch.h"
#include "ParticleSystem.h"
#include "Canvas.h"
#include "Shader.h"
#include "Mesh.h"
using love::window::WindowFlags;
@@ -199,15 +200,7 @@ public:
Image *newImage(love::image::ImageData *data);
Image *newImage(love::image::CompressedData *cdata);
/**
* Creates a Geometry object.
**/
Geometry *newGeometry(const std::vector<Vertex> &vertices, const std::vector<uint16> &vertexmap, Geometry::DrawMode mode);
/**
* Creates a quadliteral Geometry object.
**/
Geometry *newQuad(float x, float y, float w, float h, float sw, float sh);
Quad *newQuad(Quad::Viewport v, float sw, float sh);
/**
* Creates a Font object.
@@ -222,6 +215,8 @@ public:
Shader *newShader(const Shader::ShaderSources &sources);
Mesh *newMesh(const std::vector<Vertex> &vertices, Mesh::DrawMode mode = Mesh::DRAW_MODE_FAN);
/**
* Sets the foreground color.
* @param c The new foreground color.