Browse Source

Updated the readme.

Alex Szpakowski 10 years ago
parent
commit
e2652fddc1

+ 13 - 1
readme.md

@@ -24,6 +24,16 @@ Download the required frameworks from [here][dependencies] and place them in `/L
 
 
 Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-macosx` target.
 Then use the Xcode project found at `platform/xcode/love.xcodeproj` to build the `love-macosx` target.
 
 
+###iOS
+Download the required libraries from [here][dependencies-ios] and place the `include` and `libraries` folders
+into the `platform/xcode/ios` folder.
+
+Then use the Xcode project foind at `platform/xcode/love.xcodeproj` to build the `love-ios` target.
+
+Note that you must be registered in the [iOS Developer Program][iosdeveloper] in order to build for physical iOS devices.
+
+The iOS version is currently a work-in-progress.
+
 Repository information
 Repository information
 ----------------------
 ----------------------
 
 
@@ -54,7 +64,7 @@ Dependencies
 - OpenGL
 - OpenGL
 - OpenAL
 - OpenAL
 - Lua / LuaJIT / LLVM-lua
 - Lua / LuaJIT / LLVM-lua
-- DevIL with MNG and TIFF
+- jpeg-turbo
 - FreeType
 - FreeType
 - PhysicsFS
 - PhysicsFS
 - ModPlug
 - ModPlug
@@ -66,9 +76,11 @@ Dependencies
 [forums]: http://love2d.org/forums
 [forums]: http://love2d.org/forums
 [irc]: irc://irc.oftc.net/love
 [irc]: irc://irc.oftc.net/love
 [dependencies]: http://love2d.org/sdk
 [dependencies]: http://love2d.org/sdk
+[dependencies-ios]: https://dl.dropboxusercontent.com/u/4214717/love-ios-libraries-0.10.zip
 [megasource]: https://bitbucket.org/rude/megasource
 [megasource]: https://bitbucket.org/rude/megasource
 [builds]: http://love2d.org/builds
 [builds]: http://love2d.org/builds
 [stableppa]: https://launchpad.net/~bartbes/+archive/love-stable
 [stableppa]: https://launchpad.net/~bartbes/+archive/love-stable
 [unstableppa]: https://launchpad.net/~bartbes/+archive/love-unstable
 [unstableppa]: https://launchpad.net/~bartbes/+archive/love-unstable
 [aur]: http://aur.archlinux.org/packages.php?ID=35279
 [aur]: http://aur.archlinux.org/packages.php?ID=35279
 [love-experiments]: https://bitbucket.org/bartbes/love-experiments
 [love-experiments]: https://bitbucket.org/bartbes/love-experiments
+[iosdeveloper]: https://developer.apple.com/programs/ios/

+ 7 - 7
src/modules/graphics/opengl/Font.cpp

@@ -48,7 +48,7 @@ Font::Font(love::font::Rasterizer *r, const Texture::Filter &filter)
 	, textureHeight(128)
 	, textureHeight(128)
 	, filter(filter)
 	, filter(filter)
 	, useSpacesAsTab(false)
 	, useSpacesAsTab(false)
-	, indexBuffer(20) // We make this bigger at draw-time, if needed.
+	, quadIndices(20) // We make this bigger at draw-time, if needed.
 	, textureCacheID(0)
 	, textureCacheID(0)
 	, textureMemorySize(0)
 	, textureMemorySize(0)
 {
 {
@@ -523,15 +523,15 @@ void Font::drawVertices(const std::vector<DrawCommand> &drawcommands)
 	for (const DrawCommand &cmd : drawcommands)
 	for (const DrawCommand &cmd : drawcommands)
 		totalverts = std::max(cmd.startvertex + cmd.vertexcount, totalverts);
 		totalverts = std::max(cmd.startvertex + cmd.vertexcount, totalverts);
 
 
-	if ((size_t) totalverts / 4 > indexBuffer.getSize())
-		indexBuffer = VertexIndex((size_t) totalverts / 4);
+	if ((size_t) totalverts / 4 > quadIndices.getSize())
+		quadIndices = VertexIndex((size_t) totalverts / 4);
 
 
 	gl.prepareDraw();
 	gl.prepareDraw();
 
 
-	const GLenum gltype = indexBuffer.getType();
-	const size_t elemsize = indexBuffer.getElementSize();
+	const GLenum gltype = quadIndices.getType();
+	const size_t elemsize = quadIndices.getElementSize();
 
 
-	GLBuffer::Bind bind(*indexBuffer.getBuffer());
+	GLBuffer::Bind bind(*quadIndices.getBuffer());
 
 
 	// We need a separate draw call for every section of the text which uses a
 	// We need a separate draw call for every section of the text which uses a
 	// different texture than the previous section.
 	// different texture than the previous section.
@@ -542,7 +542,7 @@ void Font::drawVertices(const std::vector<DrawCommand> &drawcommands)
 
 
 		// TODO: Use glDrawElementsBaseVertex when supported?
 		// TODO: Use glDrawElementsBaseVertex when supported?
 		gl.bindTexture(cmd.texture);
 		gl.bindTexture(cmd.texture);
-		gl.drawElements(GL_TRIANGLES, count, gltype, indexBuffer.getPointer(offset));
+		gl.drawElements(GL_TRIANGLES, count, gltype, quadIndices.getPointer(offset));
 	}
 	}
 }
 }
 
 

+ 1 - 1
src/modules/graphics/opengl/Font.h

@@ -234,7 +234,7 @@ private:
 	bool useSpacesAsTab;
 	bool useSpacesAsTab;
 
 
 	// Index buffer used for drawing quads with GL_TRIANGLES.
 	// Index buffer used for drawing quads with GL_TRIANGLES.
-	VertexIndex indexBuffer;
+	VertexIndex quadIndices;
 
 
 	// ID which is incremented when the texture cache is invalidated.
 	// ID which is incremented when the texture cache is invalidated.
 	uint32 textureCacheID;
 	uint32 textureCacheID;

+ 6 - 5
src/modules/graphics/opengl/ParticleSystem.cpp

@@ -64,7 +64,7 @@ ParticleSystem::ParticleSystem(Texture *texture, uint32 size)
 	, pHead(nullptr)
 	, pHead(nullptr)
 	, pTail(nullptr)
 	, pTail(nullptr)
 	, particleVerts(nullptr)
 	, particleVerts(nullptr)
-	, ibo(1)
+	, quadIndices(1)
 	, texture(texture)
 	, texture(texture)
 	, active(true)
 	, active(true)
 	, insertMode(INSERT_MODE_TOP)
 	, insertMode(INSERT_MODE_TOP)
@@ -113,7 +113,7 @@ ParticleSystem::ParticleSystem(const ParticleSystem &p)
 	, pHead(nullptr)
 	, pHead(nullptr)
 	, pTail(nullptr)
 	, pTail(nullptr)
 	, particleVerts(nullptr)
 	, particleVerts(nullptr)
-	, ibo(p.ibo)
+	, quadIndices(p.quadIndices)
 	, texture(p.texture)
 	, texture(p.texture)
 	, active(p.active)
 	, active(p.active)
 	, insertMode(p.insertMode)
 	, insertMode(p.insertMode)
@@ -198,7 +198,7 @@ void ParticleSystem::setBufferSize(uint32 size)
 {
 {
 	if (size == 0 || size > MAX_PARTICLES)
 	if (size == 0 || size > MAX_PARTICLES)
 		throw love::Exception("Invalid buffer size");
 		throw love::Exception("Invalid buffer size");
-	ibo = VertexIndex(size);
+	quadIndices = VertexIndex(size);
 	deleteBuffers();
 	deleteBuffers();
 	createBuffers(size);
 	createBuffers(size);
 	reset();
 	reset();
@@ -888,8 +888,9 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
 	glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), &particleVerts[0].s);
 	glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), &particleVerts[0].s);
 
 
 	{
 	{
-		GLBuffer::Bind ibo_bind(*ibo.getBuffer());
-		gl.drawElements(GL_TRIANGLES, (GLsizei) ibo.getIndexCount(pCount), ibo.getType(), ibo.getPointer(0));
+		GLsizei count = (GLsizei) quadIndices.getIndexCount(pCount);
+		GLBuffer::Bind ibo_bind(*quadIndices.getBuffer());
+		gl.drawElements(GL_TRIANGLES, count, quadIndices.getType(), quadIndices.getPointer(0));
 	}
 	}
 
 
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);

+ 1 - 1
src/modules/graphics/opengl/ParticleSystem.h

@@ -577,7 +577,7 @@ protected:
 	Vertex *particleVerts;
 	Vertex *particleVerts;
 
 
 	// Vertex index buffer.
 	// Vertex index buffer.
-	VertexIndex ibo;
+	VertexIndex quadIndices;
 
 
 	// The texture to be drawn.
 	// The texture to be drawn.
 	StrongRef<Texture> texture;
 	StrongRef<Texture> texture;

+ 6 - 6
src/modules/graphics/opengl/SpriteBatch.cpp

@@ -47,7 +47,7 @@ SpriteBatch::SpriteBatch(Texture *texture, int size, int usage)
 	, next(0)
 	, next(0)
 	, color(0)
 	, color(0)
 	, array_buf(nullptr)
 	, array_buf(nullptr)
-	, element_buf(size)
+	, quad_indices(size)
 	, buffer_used_offset(0)
 	, buffer_used_offset(0)
 	, buffer_used_size(0)
 	, buffer_used_size(0)
 {
 {
@@ -202,7 +202,7 @@ void SpriteBatch::setBufferSize(int newsize)
 		void *new_data = new_array_buf->map();
 		void *new_data = new_array_buf->map();
 		memcpy(new_data, old_data, sizeof(Vertex) * 4 * std::min(newsize, size));
 		memcpy(new_data, old_data, sizeof(Vertex) * 4 * std::min(newsize, size));
 
 
-		element_buf = VertexIndex(newsize);
+		quad_indices = VertexIndex(newsize);
 	}
 	}
 	catch (love::Exception &)
 	catch (love::Exception &)
 	{
 	{
@@ -241,7 +241,7 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
 	gl.bindTexture(*(GLuint *) texture->getHandle());
 	gl.bindTexture(*(GLuint *) texture->getHandle());
 
 
 	GLBuffer::Bind array_bind(*array_buf);
 	GLBuffer::Bind array_bind(*array_buf);
-	GLBuffer::Bind element_bind(*element_buf.getBuffer());
+	GLBuffer::Bind element_bind(*quad_indices.getBuffer());
 
 
 	// Make sure the VBO isn't mapped when we draw (sends data to GPU if needed.)
 	// Make sure the VBO isn't mapped when we draw (sends data to GPU if needed.)
 	array_buf->unmap(buffer_used_offset, buffer_used_size);
 	array_buf->unmap(buffer_used_offset, buffer_used_size);
@@ -263,7 +263,7 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
 	glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), array_buf->getPointer(texel_offset));
 	glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), array_buf->getPointer(texel_offset));
 
 
 	gl.prepareDraw();
 	gl.prepareDraw();
-	gl.drawElements(GL_TRIANGLES, (GLsizei) element_buf.getIndexCount(next), element_buf.getType(), element_buf.getPointer(0));
+	gl.drawElements(GL_TRIANGLES, (GLsizei) quad_indices.getIndexCount(next), quad_indices.getType(), quad_indices.getPointer(0));
 
 
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
 	glDisableVertexAttribArray(ATTRIB_POS);
 	glDisableVertexAttribArray(ATTRIB_POS);
@@ -322,8 +322,8 @@ bool SpriteBatch::getConstant(UsageHint in, const char *&out)
 StringMap<SpriteBatch::UsageHint, SpriteBatch::USAGE_MAX_ENUM>::Entry SpriteBatch::usageHintEntries[] =
 StringMap<SpriteBatch::UsageHint, SpriteBatch::USAGE_MAX_ENUM>::Entry SpriteBatch::usageHintEntries[] =
 {
 {
 	{"dynamic", SpriteBatch::USAGE_DYNAMIC},
 	{"dynamic", SpriteBatch::USAGE_DYNAMIC},
-	{"static", SpriteBatch::USAGE_STATIC},
-	{"stream", SpriteBatch::USAGE_STREAM},
+	{"static",  SpriteBatch::USAGE_STATIC},
+	{"stream",  SpriteBatch::USAGE_STREAM},
 };
 };
 
 
 StringMap<SpriteBatch::UsageHint, SpriteBatch::USAGE_MAX_ENUM> SpriteBatch::usageHints(usageHintEntries, sizeof(usageHintEntries));
 StringMap<SpriteBatch::UsageHint, SpriteBatch::USAGE_MAX_ENUM> SpriteBatch::usageHints(usageHintEntries, sizeof(usageHintEntries));

+ 1 - 1
src/modules/graphics/opengl/SpriteBatch.h

@@ -138,7 +138,7 @@ private:
 	Color *color;
 	Color *color;
 
 
 	GLBuffer *array_buf;
 	GLBuffer *array_buf;
-	VertexIndex element_buf;
+	VertexIndex quad_indices;
 
 
 	// The portion of the vertex buffer that's been modified while mapped.
 	// The portion of the vertex buffer that's been modified while mapped.
 	size_t buffer_used_offset;
 	size_t buffer_used_offset;