mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user