summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-08-11 13:21:15 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-08-11 13:21:15 +0200
commitea62198b6ed9eae2b17688503a10f58f6601da20 (patch)
treea5ae7a9c9941a1320408382e8503363dfa0a373c /tests
parentfaa12b6a6158e9bc530916669fd9dd3544c7fe53 (diff)
test_output: always use blitting backend
This removes the currently non-working OpenGL test and always uses the blitting functions. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_output.c97
1 files changed, 1 insertions, 96 deletions
diff --git a/tests/test_output.c b/tests/test_output.c
index 0aba911..025a3a3 100644
--- a/tests/test_output.c
+++ b/tests/test_output.c
@@ -35,11 +35,9 @@
*
* This would show a test screen:
* $ ./test_output something
- * The test screen is a colored quad with 4 different colors in each corner.
*/
#include <errno.h>
-#include <GL/gl.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -47,7 +45,6 @@
#include <unistd.h>
#include "eloop.h"
-#include "gl.h"
#include "log.h"
#include "uterm.h"
#include "test_include.h"
@@ -55,15 +52,6 @@
/* eloop object */
static struct ev_eloop *eloop;
-/* a colored quad */
-float d_vert[] = { -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1 };
-float d_col[] = { 1, 1, 0, 1,
- 1, 1, 1, 1,
- 0, 1, 1, 1,
- 1, 1, 1, 1,
- 0, 0, 1, 1,
- 0, 1, 1, 1 };
-
static int blit_outputs(struct uterm_video *video)
{
struct uterm_display *iter;
@@ -125,84 +113,6 @@ static int blit_outputs(struct uterm_video *video)
return 0;
}
-static int set_outputs(struct uterm_video *video)
-{
- struct uterm_display *iter;
- int j, ret;
- struct gl_shader *shader;
- struct uterm_screen *screen;
-
- ret = gl_shader_new(&shader);
- if (ret) {
- log_err("Cannot create shader: %d", ret);
- return ret;
- }
-
- j = 0;
- iter = uterm_video_get_displays(video);
- for ( ; iter; iter = uterm_display_next(iter)) {
- log_notice("Activating display %d %p...", j, iter);
- ret = uterm_display_activate(iter, NULL);
- if (ret)
- log_err("Cannot activate display %d: %d", j, ret);
- else
- log_notice("Successfully activated display %d", j);
-
- ret = uterm_display_set_dpms(iter, UTERM_DPMS_ON);
- if (ret)
- log_err("Cannot set DPMS to ON: %d", ret);
-
- ++j;
- }
-
- iter = uterm_video_get_displays(video);
- for ( ; iter; iter = uterm_display_next(iter)) {
- if (uterm_display_get_state(iter) != UTERM_DISPLAY_ACTIVE)
- continue;
-
- ret = uterm_screen_new_single(&screen, iter);
- if (ret) {
- log_err("Cannot create temp-screen object: %d", ret);
- continue;
- }
-
- ret = uterm_screen_use(screen);
- if (ret) {
- log_err("Cannot use screen: %d", ret);
- uterm_screen_unref(screen);
- continue;
- }
-
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- glViewport(0, 0,
- uterm_screen_width(screen),
- uterm_screen_height(screen));
-
- gl_shader_draw_def(shader, d_vert, d_col, 6);
- if (gl_has_error())
- log_err("GL error occurred");
-
- ret = uterm_screen_swap(screen);
- if (ret) {
- log_err("Cannot swap screen: %d", ret);
- uterm_screen_unref(screen);
- continue;
- }
-
- log_notice("Successfully set screen on display %p", iter);
- uterm_screen_unref(screen);
- }
-
- log_notice("Waiting 5 seconds...");
- ev_eloop_run(eloop, 5000);
- log_notice("Exiting...");
-
- gl_shader_unref(shader);
-
- return 0;
-}
-
static int list_outputs(struct uterm_video *video)
{
struct uterm_display *iter;
@@ -279,12 +189,7 @@ int main(int argc, char **argv)
goto err_unref;
}
} else {
- ret = uterm_video_use(video);
- if (ret)
- ret = blit_outputs(video);
- else
- ret = set_outputs(video);
-
+ ret = blit_outputs(video);
if (ret) {
log_err("Cannot set outputs: %d", ret);
goto err_unref;