Skip to content

Commit

Permalink
Client: Renamed WindowContentTransform to ContentTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Oct 30, 2013
1 parent e276c16 commit 737885b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/client.pro
Expand Up @@ -364,6 +364,7 @@ DENG_HEADERS += \
include/ui/b_util.h \
include/ui/busyvisual.h \
include/ui/clientwindow.h \
include/ui/contenttransform.h \
include/ui/dd_input.h \
include/ui/dd_ui.h \
include/ui/dialogs/aboutdialog.h \
Expand Down Expand Up @@ -448,7 +449,6 @@ DENG_HEADERS += \
include/ui/widgets/taskbarwidget.h \
include/ui/widgets/togglewidget.h \
include/ui/widgets/variabletogglewidget.h \
include/ui/windowcontenttransform.h \
include/ui/windowsystem.h \
include/ui/zonedebug.h \
include/updater.h \
Expand Down Expand Up @@ -719,6 +719,7 @@ SOURCES += \
src/ui/b_util.cpp \
src/ui/busyvisual.cpp \
src/ui/clientwindow.cpp \
src/ui/contenttransform.cpp \
src/ui/dd_input.cpp \
src/ui/dialogs/aboutdialog.cpp \
src/ui/dialogs/audiosettingsdialog.cpp \
Expand Down Expand Up @@ -793,7 +794,6 @@ SOURCES += \
src/ui/widgets/taskbarwidget.cpp \
src/ui/widgets/togglewidget.cpp \
src/ui/widgets/variabletogglewidget.cpp \
src/ui/windowcontenttransform.cpp \
src/ui/windowsystem.cpp \
src/ui/zonedebug.cpp \
src/updater/downloaddialog.cpp \
Expand Down
@@ -1,4 +1,4 @@
/** @file windowcontenttransform.h Base class for window content transformation.
/** @file contenttransform.h Base class for window content transformation.
*
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
Expand All @@ -16,8 +16,8 @@
* http://www.gnu.org/licenses</small>
*/

#ifndef DENG_CLIENT_UI_WINDOWCONTENT_H
#define DENG_CLIENT_UI_WINDOWCONTENT_H
#ifndef DENG_CLIENT_UI_CONTENTTRANSFORM_H
#define DENG_CLIENT_UI_CONTENTTRANSFORM_H

#include <de/Vector>

Expand All @@ -26,10 +26,10 @@ class ClientWindow;
/**
* Base class for window content transformation.
*/
class WindowContentTransform
class ContentTransform
{
public:
WindowContentTransform(ClientWindow &window);
ContentTransform(ClientWindow &window);

ClientWindow &window() const;

Expand Down Expand Up @@ -64,4 +64,4 @@ class WindowContentTransform
DENG2_PRIVATE(d)
};

#endif // DENG_CLIENT_UI_WINDOWCONTENT_H
#endif // DENG_CLIENT_UI_CONTENTTRANSFORM_H
7 changes: 5 additions & 2 deletions doomsday/client/include/ui/vrcontenttransform.h
Expand Up @@ -20,9 +20,12 @@
#ifndef DENG_CLIENT_UI_VRCONTENTTRANSFORM_H
#define DENG_CLIENT_UI_VRCONTENTTRANSFORM_H

#include "windowcontenttransform.h"
#include "contenttransform.h"

class VRContentTransform : public WindowContentTransform
/**
* Window content transformation for virtual reality.
*/
class VRContentTransform : public ContentTransform
{
public:
VRContentTransform(ClientWindow &window);
Expand Down
@@ -1,4 +1,4 @@
/** @file windowcontenttransform.cpp
/** @file contenttransform.cpp Base class for window content transformation.
*
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
Expand All @@ -16,48 +16,48 @@
* http://www.gnu.org/licenses</small>
*/

#include "ui/windowcontenttransform.h"
#include "ui/contenttransform.h"
#include "ui/clientwindow.h"

using namespace de;

DENG2_PIMPL_NOREF(WindowContentTransform)
DENG2_PIMPL_NOREF(ContentTransform)
{
ClientWindow *win;
};

WindowContentTransform::WindowContentTransform(ClientWindow &window)
ContentTransform::ContentTransform(ClientWindow &window)
: d(new Instance)
{
d->win = &window;
}

ClientWindow &WindowContentTransform::window() const
ClientWindow &ContentTransform::window() const
{
return *d->win;
}

void WindowContentTransform::glInit()
void ContentTransform::glInit()
{
// nothing to do
}

void WindowContentTransform::glDeinit()
void ContentTransform::glDeinit()
{
// nothing to do
}

Vector2ui WindowContentTransform::logicalRootSize(Vector2ui const &physicalCanvasSize) const
Vector2ui ContentTransform::logicalRootSize(Vector2ui const &physicalCanvasSize) const
{
return physicalCanvasSize;
}

Vector2f WindowContentTransform::windowToLogicalCoords(de::Vector2i const &pos) const
Vector2f ContentTransform::windowToLogicalCoords(de::Vector2i const &pos) const
{
return pos;
}

void WindowContentTransform::drawTransformed()
void ContentTransform::drawTransformed()
{
return d->win->root().draw();
}
6 changes: 3 additions & 3 deletions doomsday/client/src/ui/vrcontenttransform.cpp
Expand Up @@ -43,7 +43,7 @@ DENG2_PIMPL(VRContentTransform)
void init()
{
/// @todo Only do this when Oculus Rift mode is enabled.
/// Free the allocated resources when non-Oculus mode in use.
/// Free the allocated resources when non-Rift mode in use.

OculusRiftVBuf *buf = new OculusRiftVBuf;
oculusRift.addBuffer(buf);
Expand Down Expand Up @@ -135,7 +135,7 @@ DENG2_PIMPL(VRContentTransform)
glEnable(GL_TEXTURE_2D); // Necessary until the legacy code uses GLState, too.

// Return the drawing to the full target.
GLState::setActiveRect(Rectangleui(), true);
GLState::setActiveRect(Rectangleui()/*, true*/);

canvas().renderTarget().clear(GLTarget::Color);
GLState::push()
Expand All @@ -155,7 +155,7 @@ DENG2_PIMPL(VRContentTransform)
};

VRContentTransform::VRContentTransform(ClientWindow &window)
: WindowContentTransform(window), d(new Instance(this))
: ContentTransform(window), d(new Instance(this))
{}

void VRContentTransform::glInit()
Expand Down

0 comments on commit 737885b

Please sign in to comment.