Browse Source

Removed love.window.getWidth/getHeight. Use love.graphics.getWidth/getHeight or love.window.getMode instead.

love.window.getWidth/getHeight were originally added to help deal with high-dpi mode, but the API ended up going in a different direction (love.window.getPixelScale).

--HG--
branch : minor
Alex Szpakowski 11 years ago
parent
commit
3abb1a2cbb

+ 0 - 3
src/modules/window/Window.h

@@ -96,9 +96,6 @@ public:
 
 
 	virtual std::vector<WindowSize> getFullscreenSizes(int displayindex) const = 0;
 	virtual std::vector<WindowSize> getFullscreenSizes(int displayindex) const = 0;
 
 
-	virtual int getWidth() const = 0;
-	virtual int getHeight() const = 0;
-
 	virtual void getDesktopDimensions(int displayindex, int &width, int &height) const = 0;
 	virtual void getDesktopDimensions(int displayindex, int &width, int &height) const = 0;
 
 
 	virtual bool isCreated() const = 0;
 	virtual bool isCreated() const = 0;

+ 0 - 10
src/modules/window/sdl/Window.cpp

@@ -494,16 +494,6 @@ std::vector<WindowSize> Window::getFullscreenSizes(int displayindex) const
 	return sizes;
 	return sizes;
 }
 }
 
 
-int Window::getWidth() const
-{
-	return curMode.width;
-}
-
-int Window::getHeight() const
-{
-	return curMode.height;
-}
-
 void Window::getDesktopDimensions(int displayindex, int &width, int &height) const
 void Window::getDesktopDimensions(int displayindex, int &width, int &height) const
 {
 {
 	if (displayindex >= 0 && displayindex < getDisplayCount())
 	if (displayindex >= 0 && displayindex < getDisplayCount())

+ 0 - 3
src/modules/window/sdl/Window.h

@@ -53,9 +53,6 @@ public:
 
 
 	std::vector<WindowSize> getFullscreenSizes(int displayindex) const;
 	std::vector<WindowSize> getFullscreenSizes(int displayindex) const;
 
 
-	int getWidth() const;
-	int getHeight() const;
-
 	void getDesktopDimensions(int displayindex, int &width, int &height) const;
 	void getDesktopDimensions(int displayindex, int &width, int &height) const;
 
 
 	bool isCreated() const;
 	bool isCreated() const;

+ 0 - 22
src/modules/window/wrap_Window.cpp

@@ -227,25 +227,6 @@ int w_isCreated(lua_State *L)
 	return 1;
 	return 1;
 }
 }
 
 
-int w_getWidth(lua_State *L)
-{
-	lua_pushinteger(L, instance->getWidth());
-	return 1;
-}
-
-int w_getHeight(lua_State *L)
-{
-	lua_pushinteger(L, instance->getHeight());
-	return 1;
-}
-
-int w_getDimensions(lua_State *L)
-{
-	lua_pushinteger(L, instance->getWidth());
-	lua_pushinteger(L, instance->getHeight());
-	return 2;
-}
-
 int w_getDesktopDimensions(lua_State *L)
 int w_getDesktopDimensions(lua_State *L)
 {
 {
 	int width = 0, height = 0;
 	int width = 0, height = 0;
@@ -322,9 +303,6 @@ static const luaL_Reg functions[] =
 	{ "setFullscreen", w_setFullscreen },
 	{ "setFullscreen", w_setFullscreen },
 	{ "getFullscreen", w_getFullscreen },
 	{ "getFullscreen", w_getFullscreen },
 	{ "isCreated", w_isCreated },
 	{ "isCreated", w_isCreated },
-	{ "getWidth", w_getWidth },
-	{ "getHeight", w_getHeight },
-	{ "getDimensions", w_getDimensions },
 	{ "getDesktopDimensions", w_getDesktopDimensions },
 	{ "getDesktopDimensions", w_getDesktopDimensions },
 	{ "setIcon", w_setIcon },
 	{ "setIcon", w_setIcon },
 	{ "getIcon", w_getIcon },
 	{ "getIcon", w_getIcon },

+ 0 - 3
src/modules/window/wrap_Window.h

@@ -36,9 +36,6 @@ int w_getFullscreenModes(lua_State *L);
 int w_setFullscreen(lua_State *L);
 int w_setFullscreen(lua_State *L);
 int w_getFullscreen(lua_State *L);
 int w_getFullscreen(lua_State *L);
 int w_isCreated(lua_State *L);
 int w_isCreated(lua_State *L);
-int w_getWidth(lua_State *L);
-int w_getHeight(lua_State *L);
-int w_getDimensions(lua_State *L);
 int w_getDesktopDimensions(lua_State *L);
 int w_getDesktopDimensions(lua_State *L);
 int w_setIcon(lua_State *L);
 int w_setIcon(lua_State *L);
 int w_getIcon(lua_State *L);
 int w_getIcon(lua_State *L);