summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2007-10-09 03:51:15 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2007-10-09 03:51:15 +0000
commit707965840288b69a536c3f0ee42cbe7ddb1550c6 (patch)
tree2aaa4579c97a75f728c115accc55f74f24be8610 /src
parent4b2d6d4414449938e981ed26dc46c5a7bcf1a9d8 (diff)
Moved the random texture generation code into the main Revenge code.
Diffstat (limited to 'src')
-rw-r--r--src/gl_texture.c24
-rw-r--r--src/gl_texture_mag_filter.c24
-rw-r--r--src/gl_texture_min_filter.c24
-rw-r--r--src/gl_texture_wrap_s.c24
-rw-r--r--src/gl_texture_wrap_t.c24
-rw-r--r--src/revenge_test.c21
-rw-r--r--src/revenge_test.h6
7 files changed, 27 insertions, 120 deletions
diff --git a/src/gl_texture.c b/src/gl_texture.c
index 719c2c3..302d18d 100644
--- a/src/gl_texture.c
+++ b/src/gl_texture.c
@@ -27,30 +27,6 @@
#include <revenge_test.h>
-#define TEXTURE_WIDTH 16
-#define TEXTURE_HEIGHT 16
-
-static GLuint *
-random_texture (int width, int height)
-{
- GLuint *texture = NULL;
- int i;
-
- if (!(texture = (GLuint *) malloc (width * height * sizeof (GLuint))))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- return NULL;
- }
-
- for (i = 0; i < width * height; i++)
- {
- texture[i] = random ();
- }
-
- return texture;
-}
-
void
gl_texture (void)
{
diff --git a/src/gl_texture_mag_filter.c b/src/gl_texture_mag_filter.c
index b8ed585..1aa59ab 100644
--- a/src/gl_texture_mag_filter.c
+++ b/src/gl_texture_mag_filter.c
@@ -35,30 +35,6 @@ typedef struct
#define N_(name) name, # name
-#define TEXTURE_WIDTH 16
-#define TEXTURE_HEIGHT 16
-
-static GLuint *
-random_texture (int width, int height)
-{
- GLuint *texture = NULL;
- int i;
-
- if (!(texture = (GLuint *) malloc (width * height * sizeof (GLuint))))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- return NULL;
- }
-
- for (i = 0; i < width * height; i++)
- {
- texture[i] = random ();
- }
-
- return texture;
-}
-
void
gl_texture_mag_filter (void)
{
diff --git a/src/gl_texture_min_filter.c b/src/gl_texture_min_filter.c
index 93c06df..f0a1f37 100644
--- a/src/gl_texture_min_filter.c
+++ b/src/gl_texture_min_filter.c
@@ -35,30 +35,6 @@ typedef struct
#define N_(name) name, # name
-#define TEXTURE_WIDTH 16
-#define TEXTURE_HEIGHT 16
-
-static GLuint *
-random_texture (int width, int height)
-{
- GLuint *texture = NULL;
- int i;
-
- if (!(texture = (GLuint *) malloc (width * height * sizeof (GLuint))))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- return NULL;
- }
-
- for (i = 0; i < width * height; i++)
- {
- texture[i] = random ();
- }
-
- return texture;
-}
-
void
gl_texture_min_filter (void)
{
diff --git a/src/gl_texture_wrap_s.c b/src/gl_texture_wrap_s.c
index d32f688..10384fa 100644
--- a/src/gl_texture_wrap_s.c
+++ b/src/gl_texture_wrap_s.c
@@ -35,30 +35,6 @@ typedef struct
#define N_(name) name, # name
-#define TEXTURE_WIDTH 16
-#define TEXTURE_HEIGHT 16
-
-static GLuint *
-random_texture (int width, int height)
-{
- GLuint *texture = NULL;
- int i;
-
- if (!(texture = (GLuint *) malloc (width * height * sizeof (GLuint))))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- return NULL;
- }
-
- for (i = 0; i < width * height; i++)
- {
- texture[i] = random ();
- }
-
- return texture;
-}
-
void
gl_texture_wrap_s (void)
{
diff --git a/src/gl_texture_wrap_t.c b/src/gl_texture_wrap_t.c
index e0fc946..2a0eb97 100644
--- a/src/gl_texture_wrap_t.c
+++ b/src/gl_texture_wrap_t.c
@@ -35,30 +35,6 @@ typedef struct
#define N_(name) name, # name
-#define TEXTURE_WIDTH 16
-#define TEXTURE_HEIGHT 16
-
-static GLuint *
-random_texture (int width, int height)
-{
- GLuint *texture = NULL;
- int i;
-
- if (!(texture = (GLuint *) malloc (width * height * sizeof (GLuint))))
- {
- fprintf (stderr, "%s: %s\n", program_invocation_short_name,
- strerror (errno));
- return NULL;
- }
-
- for (i = 0; i < width * height; i++)
- {
- texture[i] = random ();
- }
-
- return texture;
-}
-
void
gl_texture_wrap_t (void)
{
diff --git a/src/revenge_test.c b/src/revenge_test.c
index d3ea176..b487c54 100644
--- a/src/revenge_test.c
+++ b/src/revenge_test.c
@@ -82,6 +82,27 @@ tex_tri (void)
glEnd ();
}
+GLuint *
+random_texture (int width, int height)
+{
+ GLuint *texture = NULL;
+ int i;
+
+ if (!(texture = (GLuint *) malloc (width * height * sizeof (GLuint))))
+ {
+ fprintf (stderr, "%s: %s\n", program_invocation_short_name,
+ strerror (errno));
+ return NULL;
+ }
+
+ for (i = 0; i < width * height; i++)
+ {
+ texture[i] = random ();
+ }
+
+ return texture;
+}
+
static void
test_quiescent (void)
{
diff --git a/src/revenge_test.h b/src/revenge_test.h
index cc8da2d..8c8df9f 100644
--- a/src/revenge_test.h
+++ b/src/revenge_test.h
@@ -20,10 +20,15 @@
#ifndef __TEST_H__
#define __TEST_H__
+#include <GL/gl.h>
+#include <GL/glext.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
+#define TEXTURE_WIDTH 16
+#define TEXTURE_HEIGHT 16
+
struct test_t
{
char *name;
@@ -32,6 +37,7 @@ struct test_t
void tri (void);
void tex_tri (void);
+GLuint *random_texture (int width, int height);
void test_prologue (char *buf);
void test_epilogue (bool buf);
void test (void);