Skip to content

Commit

Permalink
Tests: Added glsandbox, test app for all GL related stuff
Browse files Browse the repository at this point in the history
This is the first GUI test app, the others are all text-based.
  • Loading branch information
skyjake committed Apr 25, 2013
1 parent e5ba2aa commit a8790c1
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doomsday/postbuild/bundleapp.sh
Expand Up @@ -52,6 +52,12 @@ $CP plugins/example/example.bundle $PLUGDIR/
$CP tools/texc/texc $APPDIR/Resources
$CP tools/md2tool/md2tool $APPDIR/Resources

# Tests
GLTEST=tests/glsandbox/test_glsandbox.app
if [ -e $GLTEST ]; then
$CP libgui/libdeng_gui*dylib $GLTEST/Contents/Frameworks
fi

if [ -e plugins/fluidsynth/audio_fluidsynth.bundle ]; then
$CP plugins/fluidsynth/audio_fluidsynth.bundle $PLUGDIR/

Expand Down
21 changes: 21 additions & 0 deletions doomsday/tests/glsandbox/glsandbox.pro
@@ -0,0 +1,21 @@
CONFIG += deng_qtopengl deng_qtgui

include(../config_test.pri)
include(../../dep_gui.pri)
include(../../dep_opengl.pri)

CONFIG -= console
TEMPLATE = app
TARGET = test_glsandbox

SOURCES += main.cpp \
testwindow.cpp

deployTest($$TARGET)

macx {
linkBinaryToBundledLibdengGui($${TARGET}.app/Contents/MacOS/$${TARGET})
}

HEADERS += \
testwindow.h
47 changes: 47 additions & 0 deletions doomsday/tests/glsandbox/main.cpp
@@ -0,0 +1,47 @@
/*
* The Doomsday Engine Project
*
* Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/

#include <de/GuiApp>
#include <de/LogBuffer>
#include <QDebug>

#include "testwindow.h"

using namespace de;

int main(int argc, char **argv)
{
try
{
GuiApp app(argc, argv);
app.initSubsystems(App::DisablePlugins);

TestWindow win;
win.show();

return app.execLoop();
}
catch(Error const &err)
{
qWarning() << err.asText();
}

qDebug("Exiting main()...");
return 0;
}
52 changes: 52 additions & 0 deletions doomsday/tests/glsandbox/testwindow.cpp
@@ -0,0 +1,52 @@
/*
* The Doomsday Engine Project
*
* Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/

#include "testwindow.h"

using namespace de;

DENG2_PIMPL(TestWindow),
DENG2_OBSERVES(Canvas, GLInit),
DENG2_OBSERVES(Canvas, GLResize),
DENG2_OBSERVES(Canvas, GLDraw)
{
Instance(Public *i) : Base(i)
{}

void canvasGLInit(Canvas &cv)
{

}

void canvasGLResized(Canvas &cv)
{

}

void canvasGLDraw(Canvas &cv)
{

}
};

TestWindow::TestWindow() : d(new Instance(this))
{
setWindowTitle("libgui GL Sandbox");
setMinimumSize(640, 480);
}
34 changes: 34 additions & 0 deletions doomsday/tests/glsandbox/testwindow.h
@@ -0,0 +1,34 @@
/*
* The Doomsday Engine Project
*
* Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GLSANDBOX_TESTWINDOW_H
#define GLSANDBOX_TESTWINDOW_H

#include <de/CanvasWindow>

class TestWindow : public de::CanvasWindow
{
public:
TestWindow();

private:
DENG2_PRIVATE(d)
};

#endif // GLSANDBOX_TESTWINDOW_H
1 change: 1 addition & 0 deletions doomsday/tests/tests.pro
Expand Up @@ -8,6 +8,7 @@ TEMPLATE = subdirs
deng_tests: SUBDIRS += \
archive \
bitfield \
glsandbox \
log \
record \
script \
Expand Down

0 comments on commit a8790c1

Please sign in to comment.