diff --git a/CMakeLists.txt b/CMakeLists.txt index 688592319..12d13c39f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,6 +272,10 @@ set(LOVE_SRC_MODULE_GRAPHICS_ROOT src/modules/graphics/Texture.h src/modules/graphics/Volatile.cpp src/modules/graphics/Volatile.h + src/modules/graphics/wrap_Quad.cpp + src/modules/graphics/wrap_Quad.h + src/modules/graphics/wrap_Texture.cpp + src/modules/graphics/wrap_Texture.h ) set(LOVE_SRC_MODULE_GRAPHICS_OPENGL @@ -297,7 +301,6 @@ set(LOVE_SRC_MODULE_GRAPHICS_OPENGL src/modules/graphics/opengl/SpriteBatch.h src/modules/graphics/opengl/Text.cpp src/modules/graphics/opengl/Text.h - src/modules/graphics/opengl/Texture.h src/modules/graphics/opengl/VertexBuffer.cpp src/modules/graphics/opengl/VertexBuffer.h src/modules/graphics/opengl/wrap_Canvas.cpp @@ -312,16 +315,12 @@ set(LOVE_SRC_MODULE_GRAPHICS_OPENGL src/modules/graphics/opengl/wrap_Mesh.h src/modules/graphics/opengl/wrap_ParticleSystem.cpp src/modules/graphics/opengl/wrap_ParticleSystem.h - src/modules/graphics/opengl/wrap_Quad.cpp - src/modules/graphics/opengl/wrap_Quad.h src/modules/graphics/opengl/wrap_Shader.cpp src/modules/graphics/opengl/wrap_Shader.h src/modules/graphics/opengl/wrap_SpriteBatch.cpp src/modules/graphics/opengl/wrap_SpriteBatch.h src/modules/graphics/opengl/wrap_Text.cpp src/modules/graphics/opengl/wrap_Text.h - src/modules/graphics/opengl/wrap_Texture.cpp - src/modules/graphics/opengl/wrap_Texture.h ) set(LOVE_SRC_MODULE_GRAPHICS diff --git a/platform/xcode/liblove.xcodeproj/project.pbxproj b/platform/xcode/liblove.xcodeproj/project.pbxproj index 83767bfab..a3dc5cf3c 100644 --- a/platform/xcode/liblove.xcodeproj/project.pbxproj +++ b/platform/xcode/liblove.xcodeproj/project.pbxproj @@ -424,7 +424,6 @@ FA0B7D511A95902C000E1D17 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BA11A95902C000E1D17 /* Text.cpp */; }; FA0B7D521A95902C000E1D17 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BA11A95902C000E1D17 /* Text.cpp */; }; FA0B7D531A95902C000E1D17 /* Text.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BA21A95902C000E1D17 /* Text.h */; }; - FA0B7D541A95902C000E1D17 /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BA31A95902C000E1D17 /* Texture.h */; }; FA0B7D551A95902C000E1D17 /* VertexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BA41A95902C000E1D17 /* VertexBuffer.cpp */; }; FA0B7D561A95902C000E1D17 /* VertexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BA41A95902C000E1D17 /* VertexBuffer.cpp */; }; FA0B7D571A95902C000E1D17 /* VertexBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BA51A95902C000E1D17 /* VertexBuffer.h */; }; @@ -446,9 +445,6 @@ FA0B7D671A95902C000E1D17 /* wrap_ParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB01A95902C000E1D17 /* wrap_ParticleSystem.cpp */; }; FA0B7D681A95902C000E1D17 /* wrap_ParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB01A95902C000E1D17 /* wrap_ParticleSystem.cpp */; }; FA0B7D691A95902C000E1D17 /* wrap_ParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BB11A95902C000E1D17 /* wrap_ParticleSystem.h */; }; - FA0B7D6A1A95902C000E1D17 /* wrap_Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB21A95902C000E1D17 /* wrap_Quad.cpp */; }; - FA0B7D6B1A95902C000E1D17 /* wrap_Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB21A95902C000E1D17 /* wrap_Quad.cpp */; }; - FA0B7D6C1A95902C000E1D17 /* wrap_Quad.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BB31A95902C000E1D17 /* wrap_Quad.h */; }; FA0B7D6D1A95902C000E1D17 /* wrap_Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB41A95902C000E1D17 /* wrap_Shader.cpp */; }; FA0B7D6E1A95902C000E1D17 /* wrap_Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB41A95902C000E1D17 /* wrap_Shader.cpp */; }; FA0B7D6F1A95902C000E1D17 /* wrap_Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BB51A95902C000E1D17 /* wrap_Shader.h */; }; @@ -458,9 +454,6 @@ FA0B7D731A95902C000E1D17 /* wrap_Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB81A95902C000E1D17 /* wrap_Text.cpp */; }; FA0B7D741A95902C000E1D17 /* wrap_Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BB81A95902C000E1D17 /* wrap_Text.cpp */; }; FA0B7D751A95902C000E1D17 /* wrap_Text.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BB91A95902C000E1D17 /* wrap_Text.h */; }; - FA0B7D761A95902C000E1D17 /* wrap_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BBA1A95902C000E1D17 /* wrap_Texture.cpp */; }; - FA0B7D771A95902C000E1D17 /* wrap_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BBA1A95902C000E1D17 /* wrap_Texture.cpp */; }; - FA0B7D781A95902C000E1D17 /* wrap_Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BBB1A95902C000E1D17 /* wrap_Texture.h */; }; FA0B7D791A95902C000E1D17 /* Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BBC1A95902C000E1D17 /* Quad.cpp */; }; FA0B7D7A1A95902C000E1D17 /* Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B7BBC1A95902C000E1D17 /* Quad.cpp */; }; FA0B7D7B1A95902C000E1D17 /* Quad.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B7BBD1A95902C000E1D17 /* Quad.h */; }; @@ -847,6 +840,12 @@ FA5D24B41A96D2EC00C6FC8F /* libphysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA5D24AD1A96D2EC00C6FC8F /* libphysfs.a */; }; FA5D24B51A96D2EC00C6FC8F /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA5D24AF1A96D2EC00C6FC8F /* libvorbis.a */; }; FA5D24CF1A96E68300C6FC8F /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA5D24CD1A96E63D00C6FC8F /* libSDL2.a */; }; + FA620A321AA2F8DB005DB4C2 /* wrap_Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA620A2E1AA2F8DB005DB4C2 /* wrap_Quad.cpp */; }; + FA620A331AA2F8DB005DB4C2 /* wrap_Quad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA620A2E1AA2F8DB005DB4C2 /* wrap_Quad.cpp */; }; + FA620A341AA2F8DB005DB4C2 /* wrap_Quad.h in Headers */ = {isa = PBXBuildFile; fileRef = FA620A2F1AA2F8DB005DB4C2 /* wrap_Quad.h */; }; + FA620A351AA2F8DB005DB4C2 /* wrap_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA620A301AA2F8DB005DB4C2 /* wrap_Texture.cpp */; }; + FA620A361AA2F8DB005DB4C2 /* wrap_Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA620A301AA2F8DB005DB4C2 /* wrap_Texture.cpp */; }; + FA620A371AA2F8DB005DB4C2 /* wrap_Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = FA620A311AA2F8DB005DB4C2 /* wrap_Texture.h */; }; FA8951A21AA2EDF300EC385A /* wrap_Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA8951A01AA2EDF300EC385A /* wrap_Event.cpp */; }; FA8951A31AA2EDF300EC385A /* wrap_Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA8951A01AA2EDF300EC385A /* wrap_Event.cpp */; }; FA8951A41AA2EDF300EC385A /* wrap_Event.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8951A11AA2EDF300EC385A /* wrap_Event.h */; }; @@ -1185,7 +1184,6 @@ FA0B7BA01A95902C000E1D17 /* SpriteBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteBatch.h; sourceTree = ""; }; FA0B7BA11A95902C000E1D17 /* Text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Text.cpp; sourceTree = ""; }; FA0B7BA21A95902C000E1D17 /* Text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Text.h; sourceTree = ""; }; - FA0B7BA31A95902C000E1D17 /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; FA0B7BA41A95902C000E1D17 /* VertexBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VertexBuffer.cpp; sourceTree = ""; }; FA0B7BA51A95902C000E1D17 /* VertexBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VertexBuffer.h; sourceTree = ""; }; FA0B7BA61A95902C000E1D17 /* wrap_Canvas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Canvas.cpp; sourceTree = ""; }; @@ -1200,16 +1198,12 @@ FA0B7BAF1A95902C000E1D17 /* wrap_Mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Mesh.h; sourceTree = ""; }; FA0B7BB01A95902C000E1D17 /* wrap_ParticleSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_ParticleSystem.cpp; sourceTree = ""; }; FA0B7BB11A95902C000E1D17 /* wrap_ParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_ParticleSystem.h; sourceTree = ""; }; - FA0B7BB21A95902C000E1D17 /* wrap_Quad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Quad.cpp; sourceTree = ""; }; - FA0B7BB31A95902C000E1D17 /* wrap_Quad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Quad.h; sourceTree = ""; }; FA0B7BB41A95902C000E1D17 /* wrap_Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Shader.cpp; sourceTree = ""; }; FA0B7BB51A95902C000E1D17 /* wrap_Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Shader.h; sourceTree = ""; }; FA0B7BB61A95902C000E1D17 /* wrap_SpriteBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_SpriteBatch.cpp; sourceTree = ""; }; FA0B7BB71A95902C000E1D17 /* wrap_SpriteBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_SpriteBatch.h; sourceTree = ""; }; FA0B7BB81A95902C000E1D17 /* wrap_Text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Text.cpp; sourceTree = ""; }; FA0B7BB91A95902C000E1D17 /* wrap_Text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Text.h; sourceTree = ""; }; - FA0B7BBA1A95902C000E1D17 /* wrap_Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Texture.cpp; sourceTree = ""; }; - FA0B7BBB1A95902C000E1D17 /* wrap_Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Texture.h; sourceTree = ""; }; FA0B7BBC1A95902C000E1D17 /* Quad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Quad.cpp; sourceTree = ""; }; FA0B7BBD1A95902C000E1D17 /* Quad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Quad.h; sourceTree = ""; }; FA0B7BBE1A95902C000E1D17 /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; @@ -1482,6 +1476,10 @@ FA5D24AD1A96D2EC00C6FC8F /* libphysfs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libphysfs.a; sourceTree = ""; }; FA5D24AF1A96D2EC00C6FC8F /* libvorbis.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libvorbis.a; sourceTree = ""; }; FA5D24CD1A96E63D00C6FC8F /* libSDL2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL2.a; sourceTree = ""; }; + FA620A2E1AA2F8DB005DB4C2 /* wrap_Quad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Quad.cpp; sourceTree = ""; }; + FA620A2F1AA2F8DB005DB4C2 /* wrap_Quad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Quad.h; sourceTree = ""; }; + FA620A301AA2F8DB005DB4C2 /* wrap_Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Texture.cpp; sourceTree = ""; }; + FA620A311AA2F8DB005DB4C2 /* wrap_Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Texture.h; sourceTree = ""; }; FA8951A01AA2EDF300EC385A /* wrap_Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Event.cpp; sourceTree = ""; }; FA8951A11AA2EDF300EC385A /* wrap_Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Event.h; sourceTree = ""; }; FA9B4A0716E1578300074F42 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = /Library/Frameworks/SDL2.framework; sourceTree = ""; }; @@ -2171,6 +2169,10 @@ FA0B7BBF1A95902C000E1D17 /* Texture.h */, FA0B7BC01A95902C000E1D17 /* Volatile.cpp */, FA0B7BC11A95902C000E1D17 /* Volatile.h */, + FA620A2E1AA2F8DB005DB4C2 /* wrap_Quad.cpp */, + FA620A2F1AA2F8DB005DB4C2 /* wrap_Quad.h */, + FA620A301AA2F8DB005DB4C2 /* wrap_Texture.cpp */, + FA620A311AA2F8DB005DB4C2 /* wrap_Texture.h */, ); path = graphics; sourceTree = ""; @@ -2200,7 +2202,6 @@ FA0B7BA01A95902C000E1D17 /* SpriteBatch.h */, FA0B7BA11A95902C000E1D17 /* Text.cpp */, FA0B7BA21A95902C000E1D17 /* Text.h */, - FA0B7BA31A95902C000E1D17 /* Texture.h */, FA0B7BA41A95902C000E1D17 /* VertexBuffer.cpp */, FA0B7BA51A95902C000E1D17 /* VertexBuffer.h */, FA0B7BA61A95902C000E1D17 /* wrap_Canvas.cpp */, @@ -2215,16 +2216,12 @@ FA0B7BAF1A95902C000E1D17 /* wrap_Mesh.h */, FA0B7BB01A95902C000E1D17 /* wrap_ParticleSystem.cpp */, FA0B7BB11A95902C000E1D17 /* wrap_ParticleSystem.h */, - FA0B7BB21A95902C000E1D17 /* wrap_Quad.cpp */, - FA0B7BB31A95902C000E1D17 /* wrap_Quad.h */, FA0B7BB41A95902C000E1D17 /* wrap_Shader.cpp */, FA0B7BB51A95902C000E1D17 /* wrap_Shader.h */, FA0B7BB61A95902C000E1D17 /* wrap_SpriteBatch.cpp */, FA0B7BB71A95902C000E1D17 /* wrap_SpriteBatch.h */, FA0B7BB81A95902C000E1D17 /* wrap_Text.cpp */, FA0B7BB91A95902C000E1D17 /* wrap_Text.h */, - FA0B7BBA1A95902C000E1D17 /* wrap_Texture.cpp */, - FA0B7BBB1A95902C000E1D17 /* wrap_Texture.h */, ); path = opengl; sourceTree = ""; @@ -2844,7 +2841,6 @@ FA0B7A661A958EA3000E1D17 /* b2Fixture.h in Headers */, FA0B7EE11A95902D000E1D17 /* wrap_Touch.h in Headers */, FA0B7AA91A958EA3000E1D17 /* b2RopeJoint.h in Headers */, - FA0B7D781A95902C000E1D17 /* wrap_Texture.h in Headers */, FA0B7E441A95902C000E1D17 /* wrap_CircleShape.h in Headers */, FA0B7EB41A95902C000E1D17 /* System.h in Headers */, FA0B7CE11A95902C000E1D17 /* Source.h in Headers */, @@ -2859,8 +2855,8 @@ FA0B793E1A958E3B000E1D17 /* StringMap.h in Headers */, FA0B793A1A958E3B000E1D17 /* Reference.h in Headers */, FA0B7DCC1A95902C000E1D17 /* Keyboard.h in Headers */, + FA620A341AA2F8DB005DB4C2 /* wrap_Quad.h in Headers */, FA0B7EA51A95902C000E1D17 /* SoundData.h in Headers */, - FA0B7D6C1A95902C000E1D17 /* wrap_Quad.h in Headers */, FA0B7A821A958EA3000E1D17 /* b2EdgeAndCircleContact.h in Headers */, FA0B79341A958E3B000E1D17 /* Object.h in Headers */, FA0B7CEA1A95902C000E1D17 /* Event.h in Headers */, @@ -2973,6 +2969,7 @@ FA0B794C1A958E3B000E1D17 /* wrap_Data.h in Headers */, FA0B7D321A95902C000E1D17 /* Graphics.h in Headers */, FA0B7E321A95902C000E1D17 /* Shape.h in Headers */, + FA620A371AA2F8DB005DB4C2 /* wrap_Texture.h in Headers */, FA0B7DBA1A95902C000E1D17 /* JoystickModule.h in Headers */, FA0B792E1A958E3B000E1D17 /* Memoizer.h in Headers */, FA0B7A731A958EA3000E1D17 /* b2ChainAndCircleContact.h in Headers */, @@ -3002,7 +2999,6 @@ FA0B7A881A958EA3000E1D17 /* b2PolygonAndCircleContact.h in Headers */, FA0B7DDE1A95902C000E1D17 /* wrap_BezierCurve.h in Headers */, FA0B7DED1A95902C000E1D17 /* Cursor.h in Headers */, - FA0B7D541A95902C000E1D17 /* Texture.h in Headers */, FA0B7E501A95902C000E1D17 /* wrap_Fixture.h in Headers */, FA0B7A491A958EA3000E1D17 /* b2PolygonShape.h in Headers */, FA0B79281A958E3B000E1D17 /* math.h in Headers */, @@ -3139,7 +3135,6 @@ FA0B7EC61A95902C000E1D17 /* ThreadModule.cpp in Sources */, FA0B7D2C1A95902C000E1D17 /* wrap_Rasterizer.cpp in Sources */, FA0B7D591A95902C000E1D17 /* wrap_Canvas.cpp in Sources */, - FA0B7D6B1A95902C000E1D17 /* wrap_Quad.cpp in Sources */, FA0B7E8F1A95902C000E1D17 /* GmeDecoder.cpp in Sources */, FA0B7CD71A95902C000E1D17 /* Audio.cpp in Sources */, FA0B7AC01A958EA3000E1D17 /* host.c in Sources */, @@ -3153,7 +3148,6 @@ FA0B7DD11A95902C000E1D17 /* love.cpp in Sources */, FA0B7AB61A958EA3000E1D17 /* ddsparse.cpp in Sources */, FA0B7D221A95902C000E1D17 /* Rasterizer.cpp in Sources */, - FA0B7D771A95902C000E1D17 /* wrap_Texture.cpp in Sources */, FA0B7A4F1A958EA3000E1D17 /* b2Draw.cpp in Sources */, FA0B7D7D1A95902C000E1D17 /* Texture.cpp in Sources */, FA0B7ECC1A95902C000E1D17 /* wrap_Channel.cpp in Sources */, @@ -3174,6 +3168,7 @@ FA0B7D871A95902C000E1D17 /* ImageData.cpp in Sources */, FA0B7AE21A958EA3000E1D17 /* auxiliar.c in Sources */, FA0B7E101A95902C000E1D17 /* FrictionJoint.cpp in Sources */, + FA620A361AA2F8DB005DB4C2 /* wrap_Texture.cpp in Sources */, FA0B7D0A1A95902C000E1D17 /* wrap_FileData.cpp in Sources */, FA0B7ABE1A958EA3000E1D17 /* compress.c in Sources */, FA0B7CF21A95902C000E1D17 /* DroppedFile.cpp in Sources */, @@ -3305,6 +3300,7 @@ FA0B7A721A958EA3000E1D17 /* b2ChainAndCircleContact.cpp in Sources */, FA0B7EAA1A95902C000E1D17 /* wrap_Sound.cpp in Sources */, FA0B79391A958E3B000E1D17 /* Reference.cpp in Sources */, + FA620A331AA2F8DB005DB4C2 /* wrap_Quad.cpp in Sources */, FA0B7E071A95902C000E1D17 /* DistanceJoint.cpp in Sources */, FA0B7A331A958EA3000E1D17 /* b2Collision.cpp in Sources */, FA0B7D9A1A95902C000E1D17 /* ImageIOHandler.cpp in Sources */, @@ -3417,7 +3413,6 @@ FA0B7EC51A95902C000E1D17 /* ThreadModule.cpp in Sources */, FA0B7D2B1A95902C000E1D17 /* wrap_Rasterizer.cpp in Sources */, FA0B7D581A95902C000E1D17 /* wrap_Canvas.cpp in Sources */, - FA0B7D6A1A95902C000E1D17 /* wrap_Quad.cpp in Sources */, FA0B7E8E1A95902C000E1D17 /* GmeDecoder.cpp in Sources */, FA0B7CD61A95902C000E1D17 /* Audio.cpp in Sources */, FA0B7A9E1A958EA3000E1D17 /* b2PrismaticJoint.cpp in Sources */, @@ -3431,7 +3426,6 @@ FA0B7DD01A95902C000E1D17 /* love.cpp in Sources */, FA0B7A521A958EA3000E1D17 /* b2Math.cpp in Sources */, FA0B7D211A95902C000E1D17 /* Rasterizer.cpp in Sources */, - FA0B7D761A95902C000E1D17 /* wrap_Texture.cpp in Sources */, FA0B7B131A958EA3000E1D17 /* udp.c in Sources */, FA0B7D7C1A95902C000E1D17 /* Texture.cpp in Sources */, FA0B7ECB1A95902C000E1D17 /* wrap_Channel.cpp in Sources */, @@ -3452,6 +3446,7 @@ FA0B7D861A95902C000E1D17 /* ImageData.cpp in Sources */, FA0B7A3E1A958EA3000E1D17 /* b2ChainShape.cpp in Sources */, FA0B7E0F1A95902C000E1D17 /* FrictionJoint.cpp in Sources */, + FA620A351AA2F8DB005DB4C2 /* wrap_Texture.cpp in Sources */, FA0B7D091A95902C000E1D17 /* wrap_FileData.cpp in Sources */, FA0B7B341A958EA3000E1D17 /* wuff_convert.c in Sources */, FA0B7CF11A95902C000E1D17 /* DroppedFile.cpp in Sources */, @@ -3583,6 +3578,7 @@ FA0B7EA91A95902C000E1D17 /* wrap_Sound.cpp in Sources */, FA0B7A981A958EA3000E1D17 /* b2MotorJoint.cpp in Sources */, FA0B7E061A95902C000E1D17 /* DistanceJoint.cpp in Sources */, + FA620A321AA2F8DB005DB4C2 /* wrap_Quad.cpp in Sources */, FA0B793B1A958E3B000E1D17 /* runtime.cpp in Sources */, FA0B7D991A95902C000E1D17 /* ImageIOHandler.cpp in Sources */, FA0B7E5D1A95902C000E1D17 /* wrap_MouseJoint.cpp in Sources */, diff --git a/src/modules/graphics/Texture.h b/src/modules/graphics/Texture.h index 75e8c6311..fb6082a75 100644 --- a/src/modules/graphics/Texture.h +++ b/src/modules/graphics/Texture.h @@ -100,6 +100,8 @@ public: virtual const Vertex *getVertices() const; + virtual const void *getHandle() const = 0; + // The default filter. static void setDefaultFilter(const Filter &f); static const Filter &getDefaultFilter(); diff --git a/src/modules/graphics/opengl/Canvas.cpp b/src/modules/graphics/opengl/Canvas.cpp index 2b8dc029b..58124a3cf 100644 --- a/src/modules/graphics/opengl/Canvas.cpp +++ b/src/modules/graphics/opengl/Canvas.cpp @@ -301,7 +301,7 @@ void Canvas::drawv(const Matrix &t, const Vertex *v) OpenGL::TempTransform transform(gl); transform.get() *= t; - predraw(); + gl.bindTexture(texture); glEnableVertexAttribArray(ATTRIB_POS); glEnableVertexAttribArray(ATTRIB_TEXCOORD); @@ -314,8 +314,6 @@ void Canvas::drawv(const Matrix &t, const Vertex *v) glDisableVertexAttribArray(ATTRIB_TEXCOORD); glDisableVertexAttribArray(ATTRIB_POS); - - postdraw(); } void Canvas::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) @@ -350,7 +348,8 @@ bool Canvas::setWrap(const Texture::Wrap &w) bool success = true; wrap = w; - if (hasLimitedNpot() && (width != next_p2(width) || height != next_p2(height))) + if ((GLAD_ES_VERSION_2_0 && !(GLAD_ES_VERSION_3_0 || GLAD_OES_texture_npot)) + && (width != next_p2(width) || height != next_p2(height))) { if (wrap.s != WRAP_CLAMP || wrap.t != WRAP_CLAMP) success = false; @@ -365,14 +364,9 @@ bool Canvas::setWrap(const Texture::Wrap &w) return success; } -GLuint Canvas::getGLTexture() const +const void *Canvas::getHandle() const { - return texture; -} - -void Canvas::predraw() -{ - gl.bindTexture(texture); + return &texture; } void Canvas::setupGrab() @@ -459,7 +453,7 @@ void Canvas::startGrab(const std::vector &canvases) for (int i = 0; i < (int) canvases.size(); i++) { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1 + i, - GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0); + GL_TEXTURE_2D, *(GLuint *) canvases[i]->getHandle(), 0); drawbuffers.push_back(GL_COLOR_ATTACHMENT1 + i); } diff --git a/src/modules/graphics/opengl/Canvas.h b/src/modules/graphics/opengl/Canvas.h index ab137512f..414f97e6d 100644 --- a/src/modules/graphics/opengl/Canvas.h +++ b/src/modules/graphics/opengl/Canvas.h @@ -28,7 +28,8 @@ #include "common/Matrix.h" #include "common/StringMap.h" #include "common/int.h" -#include "Texture.h" +#include "graphics/Texture.h" +#include "graphics/Volatile.h" #include "OpenGL.h" namespace love @@ -38,7 +39,7 @@ namespace graphics namespace opengl { -class Canvas : public Texture +class Canvas : public Texture, public Volatile { public: @@ -73,8 +74,7 @@ public: virtual void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky); virtual void setFilter(const Texture::Filter &f); virtual bool setWrap(const Texture::Wrap &w); - virtual GLuint getGLTexture() const; - virtual void predraw(); + virtual const void *getHandle() const; /** * @param canvases A list of other canvases to temporarily attach to this one, diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index 6e255ada0..ff343bbff 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -40,6 +40,7 @@ #include "Font.h" #include "Image.h" #include "graphics/Quad.h" +#include "graphics/Texture.h" #include "SpriteBatch.h" #include "ParticleSystem.h" #include "Canvas.h" diff --git a/src/modules/graphics/opengl/Image.cpp b/src/modules/graphics/opengl/Image.cpp index 90154f04d..9876a45f6 100644 --- a/src/modules/graphics/opengl/Image.cpp +++ b/src/modules/graphics/opengl/Image.cpp @@ -149,7 +149,7 @@ void Image::loadDefaultTexture() { usingDefaultTexture = true; - bind(); + gl.bindTexture(texture); setFilter(filter); // A nice friendly checkerboard to signify invalid textures... @@ -224,7 +224,8 @@ bool Image::loadVolatile() } // NPOT textures don't support mipmapping without full NPOT support. - if (hasLimitedNpot() && (width != next_p2(width) || height != next_p2(height))) + if ((GLAD_ES_VERSION_2_0 && !(GLAD_ES_VERSION_3_0 || GLAD_OES_texture_npot)) + && (width != next_p2(width) || height != next_p2(height))) { flags.mipmaps = false; filter.mipmap = FILTER_NONE; @@ -323,7 +324,7 @@ bool Image::refresh(int xoffset, int yoffset, int w, int h) throw love::Exception("Invalid rectangle dimensions."); } - bind(); + gl.bindTexture(texture); if (isCompressed()) loadTextureFromCompressedData(); @@ -344,21 +345,12 @@ bool Image::refresh(int xoffset, int yoffset, int w, int h) return true; } -void Image::predraw() -{ - bind(); -} - -void Image::postdraw() -{ -} - void Image::drawv(const Matrix &t, const Vertex *v) { OpenGL::TempTransform transform(gl); transform.get() *= t; - predraw(); + gl.bindTexture(texture); glEnableVertexAttribArray(ATTRIB_POS); glEnableVertexAttribArray(ATTRIB_TEXCOORD); @@ -371,8 +363,6 @@ void Image::drawv(const Matrix &t, const Vertex *v) glDisableVertexAttribArray(ATTRIB_TEXCOORD); glDisableVertexAttribArray(ATTRIB_POS); - - postdraw(); } void Image::draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) @@ -391,9 +381,9 @@ void Image::drawq(Quad *quad, float x, float y, float angle, float sx, float sy, drawv(t, quad->getVertices()); } -GLuint Image::getGLTexture() const +const void *Image::getHandle() const { - return texture; + return &texture; } love::image::ImageData *Image::getImageData() const @@ -425,7 +415,7 @@ void Image::setFilter(const Texture::Filter &f) filter.min = filter.mag = FILTER_NEAREST; } - bind(); + gl.bindTexture(texture); gl.setTextureFilter(filter); } @@ -434,7 +424,8 @@ bool Image::setWrap(const Texture::Wrap &w) bool success = true; wrap = w; - if (hasLimitedNpot() && (width != next_p2(width) || height != next_p2(height))) + if ((GLAD_ES_VERSION_2_0 && !(GLAD_ES_VERSION_3_0 || GLAD_OES_texture_npot)) + && (width != next_p2(width) || height != next_p2(height))) { if (wrap.s != WRAP_CLAMP || wrap.t != WRAP_CLAMP) success = false; @@ -443,7 +434,7 @@ bool Image::setWrap(const Texture::Wrap &w) wrap.s = wrap.t = WRAP_CLAMP; } - bind(); + gl.bindTexture(texture); gl.setTextureWrap(w); return success; @@ -458,7 +449,7 @@ void Image::setMipmapSharpness(float sharpness) // LOD bias has the range (-maxbias, maxbias) mipmapSharpness = std::min(std::max(sharpness, -maxMipmapSharpness + 0.01f), maxMipmapSharpness - 0.01f); - bind(); + gl.bindTexture(texture); // negative bias is sharper glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_LOD_BIAS, -mipmapSharpness); @@ -469,12 +460,6 @@ float Image::getMipmapSharpness() const return mipmapSharpness; } -void Image::bind() const -{ - if (texture != 0) - gl.bindTexture(texture); -} - const Image::Flags &Image::getFlags() const { return flags; diff --git a/src/modules/graphics/opengl/Image.h b/src/modules/graphics/opengl/Image.h index d78dcf822..74b0fc891 100644 --- a/src/modules/graphics/opengl/Image.h +++ b/src/modules/graphics/opengl/Image.h @@ -29,7 +29,8 @@ #include "common/math.h" #include "image/ImageData.h" #include "image/CompressedData.h" -#include "Texture.h" +#include "graphics/Texture.h" +#include "graphics/Volatile.h" // OpenGL #include "OpenGL.h" @@ -47,7 +48,7 @@ namespace opengl * * @author Anders Ruud **/ -class Image : public Texture +class Image : public Texture, public Volatile { public: @@ -97,15 +98,7 @@ public: **/ void drawq(Quad *quad, float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky); - /** - * Call before using this Image's texture to draw. Binds the texture, - * globally scales texture coordinates if the Image has NPOT dimensions and - * NPOT isn't supported, etc. - **/ - virtual void predraw(); - virtual void postdraw(); - - virtual GLuint getGLTexture() const; + virtual const void *getHandle() const; love::image::ImageData *getImageData() const; love::image::CompressedData *getCompressedData() const; @@ -121,8 +114,6 @@ public: **/ bool isCompressed() const; - void bind() const; - /** * Re-uploads the ImageData or CompressedData associated with this Image to * the GPU. diff --git a/src/modules/graphics/opengl/Mesh.cpp b/src/modules/graphics/opengl/Mesh.cpp index e1aa28db0..02ddc107d 100644 --- a/src/modules/graphics/opengl/Mesh.cpp +++ b/src/modules/graphics/opengl/Mesh.cpp @@ -318,7 +318,7 @@ void Mesh::draw(float x, float y, float angle, float sx, float sy, float ox, flo return; if (texture.get()) - texture->predraw(); + gl.bindTexture(*(GLuint *) texture->getHandle()); else gl.bindTexture(gl.getDefaultTexture()); @@ -394,9 +394,6 @@ void Mesh::draw(float x, float y, float angle, float sx, float sy, float ox, flo // Using the color array leaves the GL constant color undefined. gl.setColor(gl.getColor()); } - - if (texture.get()) - texture->postdraw(); } GLenum Mesh::getGLDrawMode(DrawMode mode) const diff --git a/src/modules/graphics/opengl/Mesh.h b/src/modules/graphics/opengl/Mesh.h index 7791f6c11..1c599b1d8 100644 --- a/src/modules/graphics/opengl/Mesh.h +++ b/src/modules/graphics/opengl/Mesh.h @@ -27,7 +27,7 @@ #include "common/math.h" #include "common/StringMap.h" #include "graphics/Drawable.h" -#include "Texture.h" +#include "graphics/Texture.h" #include "VertexBuffer.h" // C++ diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index d353f303a..5f4649279 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -876,7 +876,7 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo p = p->next; } - texture->predraw(); + gl.bindTexture(*(GLuint *) texture->getHandle()); gl.prepareDraw(); glEnableVertexAttribArray(ATTRIB_COLOR); @@ -896,8 +896,6 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo glDisableVertexAttribArray(ATTRIB_POS); glDisableVertexAttribArray(ATTRIB_COLOR); - texture->postdraw(); - gl.setColor(curcolor); } diff --git a/src/modules/graphics/opengl/ParticleSystem.h b/src/modules/graphics/opengl/ParticleSystem.h index 61f0926a0..717d054c1 100644 --- a/src/modules/graphics/opengl/ParticleSystem.h +++ b/src/modules/graphics/opengl/ParticleSystem.h @@ -28,7 +28,7 @@ #include "graphics/Drawable.h" #include "graphics/Color.h" #include "graphics/Quad.h" -#include "Texture.h" +#include "graphics/Texture.h" #include "VertexBuffer.h" // STL diff --git a/src/modules/graphics/opengl/Shader.cpp b/src/modules/graphics/opengl/Shader.cpp index 5ef199f14..2e6250b68 100644 --- a/src/modules/graphics/opengl/Shader.cpp +++ b/src/modules/graphics/opengl/Shader.cpp @@ -536,7 +536,7 @@ void Shader::sendMatrix(const std::string &name, int size, const GLfloat *m, int void Shader::sendTexture(const std::string &name, Texture *texture) { - GLuint gltex = texture->getGLTexture(); + GLuint gltex = *(GLuint *) texture->getHandle(); TemporaryAttacher attacher(this); diff --git a/src/modules/graphics/opengl/Shader.h b/src/modules/graphics/opengl/Shader.h index 110880aaa..6091664e5 100644 --- a/src/modules/graphics/opengl/Shader.h +++ b/src/modules/graphics/opengl/Shader.h @@ -25,8 +25,9 @@ #include "common/Object.h" #include "common/StringMap.h" #include "graphics/Graphics.h" +#include "graphics/Texture.h" +#include "graphics/Volatile.h" #include "OpenGL.h" -#include "Texture.h" // STL #include diff --git a/src/modules/graphics/opengl/SpriteBatch.cpp b/src/modules/graphics/opengl/SpriteBatch.cpp index 010788cb2..75352b113 100644 --- a/src/modules/graphics/opengl/SpriteBatch.cpp +++ b/src/modules/graphics/opengl/SpriteBatch.cpp @@ -26,7 +26,7 @@ // LOVE #include "VertexBuffer.h" -#include "Texture.h" +#include "graphics/Texture.h" // C++ #include @@ -238,7 +238,7 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float OpenGL::TempTransform transform(gl); transform.get() *= t; - texture->predraw(); + gl.bindTexture(*(GLuint *) texture->getHandle()); VertexBuffer::Bind array_bind(*array_buf); VertexBuffer::Bind element_bind(*element_buf.getVertexBuffer()); @@ -273,8 +273,6 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float glDisableVertexAttribArray(ATTRIB_COLOR); gl.setColor(curcolor); } - - texture->postdraw(); } void SpriteBatch::addv(const Vertex *v, const Matrix &m, int index) diff --git a/src/modules/graphics/opengl/SpriteBatch.h b/src/modules/graphics/opengl/SpriteBatch.h index 9f9188f47..d22f4f82d 100644 --- a/src/modules/graphics/opengl/SpriteBatch.h +++ b/src/modules/graphics/opengl/SpriteBatch.h @@ -38,12 +38,13 @@ namespace love { namespace graphics { -namespace opengl -{ // Forward declarations. class Texture; +namespace opengl +{ + class SpriteBatch : public Drawable { public: diff --git a/src/modules/graphics/opengl/Texture.h b/src/modules/graphics/opengl/Texture.h deleted file mode 100644 index eea72f571..000000000 --- a/src/modules/graphics/opengl/Texture.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (c) 2006-2015 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 - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - **/ - -#ifndef LOVE_GRAPHICS_OPENGL_TEXTURE_H -#define LOVE_GRAPHICS_OPENGL_TEXTURE_H - -// LOVE -#include "graphics/Texture.h" -#include "graphics/Volatile.h" -#include "OpenGL.h" - -namespace love -{ -namespace graphics -{ -namespace opengl -{ - -class Texture : public love::graphics::Texture, public Volatile -{ -public: - - virtual ~Texture() {} - - /** - * Gets the OpenGL id for this texture. - **/ - virtual GLuint getGLTexture() const = 0; - - /** - * Any setup the texture might need to do before drawing, e.g. binding - * the OpenGL texture for use. - **/ - virtual void predraw() {} - - /** - * Any cleanup the texture might need to do directly after drawing. - **/ - virtual void postdraw() {} - - /** - * Unextended OpenGL ES 2 doesn't support non-clamp wrap modes or mipmapping - * with non-power-of-two textures. - **/ - static bool hasLimitedNpot() - { - return GLAD_ES_VERSION_2_0 && !(GLAD_ES_VERSION_3_0 || GLAD_OES_texture_npot); - } - -}; // Texture - -} // opengl -} // graphics -} // love - -#endif // LOVE_GRAPHICS_OPENGL_TEXTURE_H diff --git a/src/modules/graphics/opengl/wrap_Canvas.h b/src/modules/graphics/opengl/wrap_Canvas.h index 20edf4ea6..9eb0fbe19 100644 --- a/src/modules/graphics/opengl/wrap_Canvas.h +++ b/src/modules/graphics/opengl/wrap_Canvas.h @@ -24,7 +24,7 @@ // LOVE #include "common/runtime.h" #include "Canvas.h" -#include "wrap_Texture.h" +#include "graphics/wrap_Texture.h" namespace love { diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 5837df84d..ce30adbc9 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -24,7 +24,7 @@ // LOVE #include "wrap_Font.h" #include "wrap_Image.h" -#include "wrap_Quad.h" +#include "graphics/wrap_Quad.h" #include "wrap_SpriteBatch.h" #include "wrap_ParticleSystem.h" #include "wrap_Canvas.h" diff --git a/src/modules/graphics/opengl/wrap_Image.h b/src/modules/graphics/opengl/wrap_Image.h index d91d81b2b..7204890be 100644 --- a/src/modules/graphics/opengl/wrap_Image.h +++ b/src/modules/graphics/opengl/wrap_Image.h @@ -24,7 +24,7 @@ // LOVE #include "common/runtime.h" #include "Image.h" -#include "wrap_Texture.h" +#include "graphics/wrap_Texture.h" namespace love { diff --git a/src/modules/graphics/opengl/wrap_Mesh.cpp b/src/modules/graphics/opengl/wrap_Mesh.cpp index 3b9c267f3..5775db7a3 100644 --- a/src/modules/graphics/opengl/wrap_Mesh.cpp +++ b/src/modules/graphics/opengl/wrap_Mesh.cpp @@ -22,7 +22,7 @@ #include "wrap_Mesh.h" #include "Image.h" #include "Canvas.h" -#include "wrap_Texture.h" +#include "graphics/wrap_Texture.h" // C++ #include diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index 19fc2767e..c29e93e3b 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -24,7 +24,7 @@ #include "Image.h" #include "Canvas.h" -#include "wrap_Texture.h" +#include "graphics/wrap_Texture.h" // C #include diff --git a/src/modules/graphics/opengl/wrap_Shader.cpp b/src/modules/graphics/opengl/wrap_Shader.cpp index 1050ea5f6..4f7bdd83e 100644 --- a/src/modules/graphics/opengl/wrap_Shader.cpp +++ b/src/modules/graphics/opengl/wrap_Shader.cpp @@ -19,7 +19,7 @@ **/ #include "wrap_Shader.h" -#include "wrap_Texture.h" +#include "graphics/wrap_Texture.h" #include #include diff --git a/src/modules/graphics/opengl/wrap_SpriteBatch.cpp b/src/modules/graphics/opengl/wrap_SpriteBatch.cpp index 2436686af..35096170d 100644 --- a/src/modules/graphics/opengl/wrap_SpriteBatch.cpp +++ b/src/modules/graphics/opengl/wrap_SpriteBatch.cpp @@ -22,7 +22,7 @@ #include "wrap_SpriteBatch.h" #include "Image.h" #include "Canvas.h" -#include "wrap_Texture.h" +#include "graphics/wrap_Texture.h" // C++ #include diff --git a/src/modules/graphics/opengl/wrap_Quad.cpp b/src/modules/graphics/wrap_Quad.cpp similarity index 98% rename from src/modules/graphics/opengl/wrap_Quad.cpp rename to src/modules/graphics/wrap_Quad.cpp index 77a2dbeb9..2ca990755 100644 --- a/src/modules/graphics/opengl/wrap_Quad.cpp +++ b/src/modules/graphics/wrap_Quad.cpp @@ -25,8 +25,6 @@ namespace love { namespace graphics { -namespace opengl -{ Quad *luax_checkquad(lua_State *L, int idx) { @@ -78,6 +76,5 @@ extern "C" int luaopen_quad(lua_State *L) return luax_register_type(L, "Quad", functions); } -} // opengl } // graphics } // love diff --git a/src/modules/graphics/opengl/wrap_Quad.h b/src/modules/graphics/wrap_Quad.h similarity index 86% rename from src/modules/graphics/opengl/wrap_Quad.h rename to src/modules/graphics/wrap_Quad.h index a766ecb81..5cc6f9963 100644 --- a/src/modules/graphics/opengl/wrap_Quad.h +++ b/src/modules/graphics/wrap_Quad.h @@ -18,27 +18,24 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H -#define LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H +#ifndef LOVE_GRAPHICS_WRAP_QUAD_H +#define LOVE_GRAPHICS_WRAP_QUAD_H // LOVE #include "common/runtime.h" -#include "graphics/Quad.h" +#include "Quad.h" namespace love { namespace graphics { -namespace opengl -{ Quad *luax_checkquad(lua_State *L, int idx); int w_Quad_setViewport(lua_State *L); int w_Quad_getViewport(lua_State *L); extern "C" int luaopen_quad(lua_State *L); -} // opengl } // graphics } // love -#endif // LOVE_GRAPHICS_OPENGL_WRAP_QUAD_H +#endif // LOVE_GRAPHICS_WRAP_QUAD_H diff --git a/src/modules/graphics/opengl/wrap_Texture.cpp b/src/modules/graphics/wrap_Texture.cpp similarity index 99% rename from src/modules/graphics/opengl/wrap_Texture.cpp rename to src/modules/graphics/wrap_Texture.cpp index a318a3b1d..8590e46f9 100644 --- a/src/modules/graphics/opengl/wrap_Texture.cpp +++ b/src/modules/graphics/wrap_Texture.cpp @@ -24,8 +24,6 @@ namespace love { namespace graphics { -namespace opengl -{ Texture *luax_checktexture(lua_State *L, int idx) { @@ -127,7 +125,5 @@ int w_Texture_getWrap(lua_State *L) return 2; } - -} // opengl } // graphics } // love diff --git a/src/modules/graphics/opengl/wrap_Texture.h b/src/modules/graphics/wrap_Texture.h similarity index 89% rename from src/modules/graphics/opengl/wrap_Texture.h rename to src/modules/graphics/wrap_Texture.h index bb9c54a05..dd75da6ad 100644 --- a/src/modules/graphics/opengl/wrap_Texture.h +++ b/src/modules/graphics/wrap_Texture.h @@ -18,8 +18,8 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#ifndef LOVE_GRAPHICS_OPENGL_WRAP_TEXTURE_H -#define LOVE_GRAPHICS_OPENGL_WRAP_TEXTURE_H +#ifndef LOVE_GRAPHICS_WRAP_TEXTURE_H +#define LOVE_GRAPHICS_WRAP_TEXTURE_H #include "Texture.h" #include "common/runtime.h" @@ -28,8 +28,6 @@ namespace love { namespace graphics { -namespace opengl -{ Texture *luax_checktexture(lua_State *L, int idx); int w_Texture_getWidth(lua_State *L); @@ -40,8 +38,7 @@ int w_Texture_getFilter(lua_State *L); int w_Texture_setWrap(lua_State *L); int w_Texture_getWrap(lua_State *L); -} // opengl } // graphics } // love -#endif // LOVE_GRAPHICS_OPENGL_WRAP_TEXTURE_H +#endif // LOVE_GRAPHICS_WRAP_TEXTURE_H