mv getBuffer buffer;
@@ -314,7 +314,7 @@ static int l_lovrGraphicsGetLimits(lua_State* L) {
return 1;
}
-static int l_lovrGraphicsGetBuffer(lua_State* L) {
+static int l_lovrGraphicsNewBuffer(lua_State* L) {
BufferInfo info = { 0 };
luax_checkbufferformat(L, 2, &info);
@@ -335,7 +335,7 @@ static int l_lovrGraphicsGetBuffer(lua_State* L) {
void* pointer;
bool hasData = !lua_isnumber(L, 1);
- Buffer* buffer = lovrGraphicsGetBuffer(&info, hasData ? &pointer : NULL);
+ Buffer* buffer = lovrBufferCreate(&info, hasData ? &pointer : NULL);
if (hasData) {
lua_settop(L, 1);
@@ -347,7 +347,7 @@ static int l_lovrGraphicsGetBuffer(lua_State* L) {
return 1;
}
-static int l_lovrGraphicsNewBuffer(lua_State* L) {
+static int l_lovrGraphicsBuffer(lua_State* L) {
BufferInfo info = { 0 };
luax_checkbufferformat(L, 2, &info);
@@ -368,7 +368,7 @@ static int l_lovrGraphicsNewBuffer(lua_State* L) {
void* pointer;
bool hasData = !lua_isnumber(L, 1);
- Buffer* buffer = lovrBufferCreate(&info, hasData ? &pointer : NULL);
+ Buffer* buffer = lovrGraphicsGetBuffer(&info, hasData ? &pointer : NULL);
if (hasData) {
lua_settop(L, 1);
@@ -385,8 +385,8 @@ static const luaL_Reg lovrGraphics[] = {
{ "getDevice", l_lovrGraphicsGetDevice },
{ "getFeatures", l_lovrGraphicsGetFeatures },
{ "getLimits", l_lovrGraphicsGetLimits },
- { "getBuffer", l_lovrGraphicsGetBuffer },
{ "newBuffer", l_lovrGraphicsNewBuffer },
+ { "buffer", l_lovrGraphicsBuffer },
{ NULL, NULL }
};
