Commit 47657ff6 authored by Kenneth Moreland's avatar Kenneth Moreland

Removed OpenGL rendering dependency from core. (broken)

image.c is now completely OpenGL independent.  The rendering callbacks
now pass the parameters that IceT fiddles with (matrices, background,
readback region) and lets the user code render with whatever system
available.  The OpenGL layer now has the code that sets up OpenGL before
making its own callback (which, like before, takes no arguments) and
then reading the data back from the OpenGL buffers.

I know that there are glaring bugs in this code.  I will address them
soon.
parent 5acc0af2
......@@ -70,3 +70,12 @@ behaves just as the old function did.
Removed ICET_TILE_MAX_PIXELS.
Images hold width/height. You must specify both when creating them.
Renamed icetDrawFunc -> icetDrawCallback. Changed the callback function to
take the three rendering parameters that IceT manipulates (the projection
and modelview matricies and the background color), a viewport of pixels for
which data is needed, and an image to put the result in.
Added icetGLDrawCallback. Provides a callback that replicates the old
icetDrawFunc. It has the OpenGL parameters automatically set up and
automatically reads back the appropriate frame buffers.
......@@ -9,6 +9,7 @@
SET(ICET_GL_SRCS
icetGLState.c
icetGLDraw.c
icetGLImage.c
)
ADD_LIBRARY(icet_gl ${ICET_GL_SRCS})
......
......@@ -11,6 +11,8 @@
#include <state.h>
#include <context.h>
#include "icetGLImage.h"
#include <stdlib.h>
#include <string.h>
......@@ -20,6 +22,11 @@ static IceTSizeType display_buffer_size = 0;
static void inflateBuffer(IceTUByte *buffer,
IceTSizeType width, IceTSizeType height);
void icetGLDrawCallback(IceTGLDrawCallbackType func)
{
icetStateSetPointer(ICET_GL_DRAW_FUNCTION, (IceTVoid *)func);
}
IceTImage icetGLDrawFrame(void)
{
IceTImage image;
......@@ -29,6 +36,8 @@ IceTImage icetGLDrawFrame(void)
IceTFloat background_color[4];
IceTDouble projection_matrix[16];
IceTDouble modelview_matrix[16];
IceTVoid *value;
IceTDrawCallbackType original_callback;
IceTDouble buf_write_time;
icetGetIntegerv(ICET_TILE_DISPLAYED, &display_tile);
......@@ -48,11 +57,27 @@ IceTImage icetGLDrawFrame(void)
glGetDoublev(GL_PROJECTION_MATRIX, projection_matrix);
glGetDoublev(GL_MODELVIEW_MATRIX, modelview_matrix);
/* Check the GL callback. */
icetGetPointerv(ICET_GL_DRAW_FUNCTION, &value);
if (value == NULL) {
icetRaiseError("GL Drawing function not set. Call icetGLDrawCallback.",
ICET_INVALID_OPERATION);
return icetImageNull();
}
/* Set up core callback to call the GL layer. */
icetGetPointerv(ICET_DRAW_FUNCTION, &value);
original_callback = (IceTDrawCallbackType)value;
icetDrawCallback(icetGLDrawCallbackFunction);
/* Hand control to the core layer to render and composite. */
image = icetDrawFrame(projection_matrix,
modelview_matrix,
background_color);
/* Restore core IceT callback. */
icetDrawCallback(original_callback);
/* Fix background color. */
glClearColor(background_color[0], background_color[1],
background_color[2], background_color[3]);
......@@ -131,6 +156,7 @@ IceTImage icetGLDrawFrame(void)
glMatrixMode(GL_PROJECTION);
glLoadMatrixd(projection_matrix);
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview_matrix);
/* Calculate display times. */
buf_write_time = icetWallTime() - buf_write_time;
......
/* -*- c -*- *******************************************************/
/*
* Copyright (C) 2010 Sandia Corporation
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the U.S. Government.
*/
#include "icetGLImage.h"
#include <IceTGL.h>
#include <diagnostics.h>
#include <state.h>
void icetGLDrawCallbackFunction(const IceTDouble *projection_matrix,
const IceTDouble *modelview_matrix,
const IceTFloat *background_color,
const IceTInt *readback_viewport,
IceTImage result)
{
IceTSizeType width = icetImageGetWidth(result);
IceTSizeType height = icetImageGetHeight(result);
GLint gl_viewport[4];
glGetIntegerv(GL_VIEWPORT, gl_viewport);
/* Check OpenGL state. */
{
if ((gl_viewport[2] != width) || (gl_viewport[3] != height)) {
icetRaiseError("OpenGL viewport different than expected."
" Was it changed?", ICET_SANITY_CHECK_FAIL);
}
}
/* Set up OpenGL. */
{
/* Load the matrices. */
glMatrixMode(GL_PROJECTION);
glLoadMatrixd(projection_matrix);
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview_matrix);
/* Set the clear color as the background IceT currently wants. */
glClearColor(background_color[0], background_color[1],
background_color[2], background_color[3]);
}
/* Call the rendering callback. */
{
IceTVoid *value;
IceTGLDrawCallbackType callback;
icetRaiseDebug("Calling OpenGL draw function.");
icetGetPointerv(ICET_GL_DRAW_FUNCTION, &value);
callback = (IceTGLDrawCallbackType)value;
(*callback)();
}
/* Read the OpenGL buffers. */
{
IceTEnum color_format = icetImageGetColorFormat(result);
IceTEnum depth_format = icetImageGetDepthFormat(result);
IceTEnum readbuffer;
IceTSizeType x_offset = gl_viewport[0] + readback_viewport[0];
IceTSizeType y_offset = gl_viewport[1] + readback_viewport[1];
IceTDouble read_time;
IceTDouble render_time;
IceTDouble timer;
glPixelStorei(GL_PACK_ROW_LENGTH, icetImageGetWidth(result));
/* These pixel store parameters are not working on one of the platforms
* I am testing on (thank you Mac). Instead of using these, just offset
* the buffers we read in from. */
/* glPixelStorei(GL_PACK_SKIP_PIXELS, readback_viewport[0]); */
/* glPixelStorei(GL_PACK_SKIP_ROWS, readback_viewport[1]); */
icetGetEnumv(ICET_GL_READ_BUFFER, &readbuffer);
glReadBuffer(readbuffer);
timer = icetWallTime();
if (color_format == ICET_IMAGE_COLOR_RGBA_UBYTE) {
IceTUInt *colorBuffer = icetImageGetColorUInt(result);
glReadPixels(x_offset, y_offset,
readback_viewport[2], readback_viewport[3],
GL_RGBA, GL_UNSIGNED_BYTE,
colorBuffer + ( readback_viewport[0]
+ width*readback_viewport[1]));
} else if (color_format == ICET_IMAGE_COLOR_RGBA_FLOAT) {
IceTFloat *colorBuffer = icetImageGetColorFloat(result);
glReadPixels(x_offset, y_offset,
readback_viewport[2], readback_viewport[3],
GL_RGBA, GL_FLOAT,
colorBuffer + 4*( readback_viewport[0]
+ width*readback_viewport[1]));
} else if (color_format != ICET_IMAGE_COLOR_NONE) {
icetRaiseError("Invalid color format.", ICET_SANITY_CHECK_FAIL);
}
if (depth_format == ICET_IMAGE_DEPTH_FLOAT) {
IceTFloat *depthBuffer = icetImageGetDepthFloat(result);;
glReadPixels(x_offset, y_offset,
readback_viewport[2], readback_viewport[3],
GL_DEPTH_COMPONENT, GL_FLOAT,
depthBuffer + ( readback_viewport[0]
+ width*readback_viewport[1]));
} else if (depth_format != ICET_IMAGE_DEPTH_NONE) {
icetRaiseError("Invalid depth format.", ICET_SANITY_CHECK_FAIL);
}
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
/* glPixelStorei(GL_PACK_SKIP_PIXELS, 0); */
/* glPixelStorei(GL_PACK_SKIP_ROWS, 0); */
icetGetDoublev(ICET_BUFFER_READ_TIME, &read_time);
read_time += icetWallTime() - timer;
icetStateSetDouble(ICET_BUFFER_READ_TIME, read_time);
/* Subtract read time from render time since the render time is being
recorded as we are in this funtion. */
icetGetDoublev(ICET_RENDER_TIME, &render_time);
render_time -= read_time;
icetStateSetDouble(ICET_RENDER_TIME, render_time);
}
}
/* -*- c -*- *******************************************************/
/*
* Copyright (C) 2010 Sandia Corporation
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the U.S. Government.
*/
#ifndef __icetGLImage_h
#define __icetGLImage_h
#include <IceTGL.h>
ICET_GL_EXPORT void icetGLDrawCallbackFunction(
const IceTDouble *projection_matrix,
const IceTDouble *modelview_matrix,
const IceTFloat *background_color,
const IceTInt *readback_viewport,
IceTImage result);
#endif //__icetGLImage_h
......@@ -25,6 +25,8 @@ void icetGLInitialize(void)
icetGLSetReadBuffer(GL_BACK);
icetStateSetPointer(ICET_GL_DRAW_FUNCTION, NULL);
icetEnable(ICET_GL_DISPLAY);
icetDisable(ICET_GL_DISPLAY_COLORED_BACKGROUND);
icetDisable(ICET_GL_DISPLAY_INFLATE);
......
......@@ -18,16 +18,22 @@
* (i.e. an allocated IceTSparseImage pointer).
*
* The following macros are optional:
* PADDING - If defined, enables inactive pixels to be placed
* around the file. If defined, then SPACE_BOTTOM, SPACE_TOP,
* SPACE_LEFT, SPACE_RIGHT, FULL_WIDTH, and FULL_HEIGHT must
* all also be defined.
* OFFSET - If defined to a number (or variable holding a number), skips
* that many pixels at the beginning of the image.
* PIXEL_COUNT - If defined to a number (or a variable holding a number),
* uses this as the size of the image rather than the actual size
* defined in the image. This should be defined if OFFSET is
* defined.
* PADDING - If defined, enables inactive pixels to be placed
* around the file. If defined, then SPACE_BOTTOM, SPACE_TOP,
* SPACE_LEFT, SPACE_RIGHT, FULL_WIDTH, and FULL_HEIGHT must
* all also be defined.
* REGION - If defined, pixels are taken from a particular region of the
* image. Sort of like OFFSET/PIXEL_COUNT except that the pixels
* are contiguous in a 2D region rather than the 1D layout of
* pixels in memory. If defined, then REGION_OFFSET_X,
* REGION_OFFSET_Y, REGION_WIDTH, and REGION_HEIGHT must also be
* defined.
*
* All of the above macros are undefined at the end of this file.
*/
......@@ -45,10 +51,23 @@
#error Need ACTIVE_RUN_LENGTH macro. Is this included in image.c?
#endif
#ifdef REGION
#ifdef OFFSET
#error REGION and OFFSET are incompatible
#else
#define OFFSET (REGION_OFFSET_X + _input_width*(REGION_OFFSET_Y))
#endif
#endif
{
IceTEnum _color_format, _depth_format;
IceTSizeType _pixel_count;
IceTEnum _composite_mode;
#ifdef REGION
IceTSizeType _input_width = icetImageGetWidth(INPUT_IMAGE);
IceTSizeType _region_width = REGION_WIDTH;
IceTSizeType _region_x_skip = _input_width - (REGION_WIDTH);
#endif
icetGetEnumv(ICET_COMPOSITE_MODE, &_composite_mode);
......@@ -82,6 +101,14 @@
ICET_SANITY_CHECK_FAIL);
}
#endif /*PADDING*/
#ifdef REGION
if ( (REGION_OFFSET_X < 0) || (REGION_OFFSET_Y < 0)
|| (REGION_OFFSET_X+REGION_WIDTH > icetImageGetWidth(INPUT_IMAGE))
|| (REGION_OFFSET_Y+REGION_HEIGHT > icetImageGetWidth(INPUT_IMAGE)) ) {
icetRaiseError("Size of input incompatible with region.",
ICET_SANITY_CHECK_FAIL);
}
#endif /*REGION*/
#endif /*DEBUG*/
if (_composite_mode == ICET_COMPOSITE_MODE_Z_BUFFER) {
......@@ -95,6 +122,9 @@
const IceTUInt *_color;
IceTUInt *_c_out;
IceTFloat *_d_out;
#ifdef REGION
IceTSizeType _region_count = 0;
#endif
_color = icetImageGetColorUInt(INPUT_IMAGE);
#ifdef OFFSET
_color += OFFSET;
......@@ -110,7 +140,17 @@
_d_out = (IceTFloat *)dest; \
_d_out[0] = _depth[0]; \
dest += sizeof(IceTFloat);
#ifdef REGION
#define CT_INCREMENT_PIXEL() _color++; _depth++; \
_region_count++; \
if (_region_count >= _region_width) { \
_color += _region_x_skip; \
_depth += _region_x_skip; \
_region_count = 0; \
}
#else
#define CT_INCREMENT_PIXEL() _color++; _depth++;
#endif
#ifdef PADDING
#define CT_PADDING
#define CT_SPACE_BOTTOM SPACE_BOTTOM
......@@ -124,6 +164,9 @@
} else if (_color_format == ICET_IMAGE_COLOR_RGBA_FLOAT) {
const IceTFloat *_color;
IceTFloat *_out;
#ifdef REGION
IceTSizeType _region_count = 0;
#endif
_color = icetImageGetColorFloat(INPUT_IMAGE);
#ifdef OFFSET
_color += 4*(OFFSET);
......@@ -140,7 +183,17 @@
_out[3] = _color[3]; \
_out[4] = _depth[0]; \
dest += 5*sizeof(IceTFloat);
#ifdef REGION
#define CT_INCREMENT_PIXEL() _color += 4; _depth++; \
_region_count++; \
if (_region_count >= _region_width) { \
_color += 4*_region_x_skip; \
_depth += _region_x_skip; \
_region_count = 0; \
}
#else
#define CT_INCREMENT_PIXEL() _color += 4; _depth++;
#endif
#ifdef PADDING
#define CT_PADDING
#define CT_SPACE_BOTTOM SPACE_BOTTOM
......@@ -153,6 +206,9 @@
#include "compress_template_body.h"
} else if (_color_format == ICET_IMAGE_COLOR_NONE) {
IceTFloat *_out;
#ifdef REGION
IceTSizeType _region_count = 0;
#endif
#define CT_COMPRESSED_IMAGE OUTPUT_SPARSE_IMAGE
#define CT_COLOR_FORMAT _color_format
#define CT_DEPTH_FORMAT _depth_format
......@@ -161,7 +217,16 @@
#define CT_WRITE_PIXEL(dest) _out = (IceTFloat *)dest; \
_out[0] = _depth[0]; \
dest += 1*sizeof(IceTFloat);
#ifdef REGION
#define CT_INCREMENT_PIXEL() _depth++; \
_region_count++; \
if (_region_count >= _region_width) { \
_depth += _region_x_skip; \
_region_count = 0; \
}
#else
#define CT_INCREMENT_PIXEL() _depth++;
#endif
#ifdef PADDING
#define CT_PADDING
#define CT_SPACE_BOTTOM SPACE_BOTTOM
......@@ -193,6 +258,9 @@
if (_color_format == ICET_IMAGE_COLOR_RGBA_UBYTE) {
const IceTUInt *_color;
IceTUInt *_out;
#ifdef REGION
IceTSizeType _region_count = 0;
#endif
_color = icetImageGetColorUInt(INPUT_IMAGE);
#ifdef OFFSET
_color += OFFSET;
......@@ -205,7 +273,16 @@
#define CT_WRITE_PIXEL(dest) _out = (IceTUInt *)dest; \
_out[0] = _color[0]; \
dest += sizeof(IceTUInt);
#ifdef REGION
#define CT_INCREMENT_PIXEL() _color++; \
_region_count++; \
if (_region_count >= _region_width) { \
_color += _region_x_skip; \
_region_count = 0; \
}
#else
#define CT_INCREMENT_PIXEL() _color++;
#endif
#ifdef PADDING
#define CT_PADDING
#define CT_SPACE_BOTTOM SPACE_BOTTOM
......@@ -219,6 +296,9 @@
} else if (_color_format == ICET_IMAGE_COLOR_RGBA_FLOAT) {
const IceTFloat *_color;
IceTFloat *_out;
#ifdef REGION
IceTSizeType _region_count = 0;
#endif
_color = icetImageGetColorFloat(INPUT_IMAGE);
#ifdef OFFSET
_color += 4*(OFFSET);
......@@ -234,7 +314,16 @@
_out[2] = _color[2]; \
_out[3] = _color[3]; \
dest += 4*sizeof(IceTUInt);
#ifdef REGION
#define CT_INCREMENT_PIXEL() _color += 4; \
_region_count++; \
if (_region_count >= _region_width) { \
_color += 4*_region_x_skip; \
_region_count = 0; \
}
#else
#define CT_INCREMENT_PIXEL() _color += 4;
#endif
#ifdef PADDING
#define CT_PADDING
#define CT_SPACE_BOTTOM SPACE_BOTTOM
......@@ -294,6 +383,14 @@
#undef FULL_HEIGHT
#endif
#ifdef REGION
#undef REGION
#undef REGION_OFFSET_X
#undef REGION_OFFSET_Y
#undef REGION_WIDTH
#undef REGION_HEIGHT
#endif
#ifdef OFFSET
#undef OFFSET
#endif
......
......@@ -26,7 +26,7 @@
* CT_ACTIVE() - provides a true value if the current pixel is active.
* CT_WRITE_PIXEL(pointer) - writes the current pixel to the pointer and
* increments the pointer.
* CT_INCREMENT_PIXEL() - Increments to the next pixel.
* CT_INCREMENT_PIXEL() - Increments to the next input pixel.
*
* The following macros are optional:
* CT_PADDING - If defined, enables inactive pixels to be placed
......
......@@ -28,7 +28,7 @@
static void multMatrix(IceTDouble *C, const IceTDouble *A, const IceTDouble *B);
void icetDrawFunc(IceTCallback func)
void icetDrawCallback(IceTDrawCallbackType func)
{
icetStateSetPointer(ICET_DRAW_FUNCTION, (IceTVoid *)func);
}
......@@ -628,7 +628,8 @@ IceTImage icetDrawFrame(const IceTDouble *projection_matrix,
icetGetPointerv(ICET_DRAW_FUNCTION, &value);
if (value == NULL) {
icetRaiseError("Drawing function not set.", ICET_INVALID_OPERATION);
icetRaiseError("Drawing function not set. Call icetDrawCallback.",
ICET_INVALID_OPERATION);
return icetImageNull();
}
icetRaiseDebug("Calling strategy.compose");
......
This diff is collapsed.
......@@ -124,6 +124,7 @@ void icetStateSetDefaults(void)
icetEnable(ICET_COMPOSITE_ONE_BUFFER);
icetStateSetBoolean(ICET_IS_DRAWING_FRAME, 0);
icetStateSetBoolean(ICET_RENDER_BUFFER_SIZE, 0);
icetStateResetTiming();
}
......
......@@ -88,10 +88,6 @@ ICET_EXPORT IceTContext icetGetContext(void);
ICET_EXPORT void icetSetContext(IceTContext context);
ICET_EXPORT void icetCopyState(IceTContext dest, const IceTContext src);
typedef void (*IceTCallback)(void);
ICET_EXPORT void icetDrawFunc(IceTCallback func);
#define ICET_BOOLEAN (IceTEnum)0x8000
#define ICET_BYTE (IceTEnum)0x8001
#define ICET_SHORT (IceTEnum)0x8002
......@@ -180,6 +176,14 @@ ICET_EXPORT void icetDataReplicationGroup(IceTInt size,
const IceTInt *processes);
ICET_EXPORT void icetDataReplicationGroupColor(IceTInt color);
typedef void (*IceTDrawCallbackType)(const IceTDouble *projection_matrix,
const IceTDouble *modelview_matrix,
const IceTFloat *background_color,
const IceTInt *readback_viewport,
IceTImage result);
ICET_EXPORT void icetDrawCallback(IceTDrawCallbackType func);
ICET_EXPORT IceTImage icetDrawFrame(const IceTDouble *projection_matrix,
const IceTDouble *modelview_matrix,
const IceTFloat *background_color);
......@@ -246,6 +250,8 @@ ICET_EXPORT void icetDiagnostics(IceTBitField mask);
#define ICET_TOTAL_IMAGE_COUNT (ICET_STATE_FRAME_START | (IceTEnum)0x000B)
#define ICET_RENDERED_VIEWPORT (ICET_STATE_FRAME_START | (IceTEnum)0x0010)
#define ICET_RENDER_BUFFER (ICET_STATE_FRAME_START | (IceTEnum)0x0011)
#define ICET_RENDER_BUFFER_SIZE (ICET_STATE_FRAME_START | (IceTEnum)0x0012)
#define ICET_STATE_TIMING_START (IceTEnum)0x000000C0
......
......@@ -29,15 +29,20 @@ ICET_GL_EXPORT void icetGLSetReadBuffer(GLenum mode);
ICET_GL_EXPORT IceTImage icetGLDrawFrame(void);
typedef void (*IceTGLDrawCallbackType)(void);
ICET_GL_EXPORT void icetGLDrawCallback(IceTGLDrawCallbackType func);
#define ICET_GL_STATE_START (IceTEnum)0x00000140
#define ICET_GL_INITIALIZED (ICET_GL_STATE_START | (IceTEnum)0x0001)
#define ICET_GL_READ_BUFFER (ICET_GL_STATE_START | (IceTEnum)0x0010)
#define ICET_GL_DRAW_FUNCTION (ICET_GL_STATE_START | (IceTEnum)0x0020)
#define ICET_GL_STATE_ENABLE_START (ICET_STATE_ENABLE_START | (IceTEnum)0x0030)
/* These should go to GL layer. */
#define ICET_GL_DISPLAY (ICET_GL_STATE_ENABLE_START | (IceTEnum)0x0000)
#define ICET_GL_DISPLAY_COLORED_BACKGROUND (ICET_GL_STATE_ENABLE_START | (IceTEnum)0x0001)
#define ICET_GL_DISPLAY_INFLATE (ICET_GL_STATE_ENABLE_START | (IceTEnum)0x0002)
......
......@@ -32,11 +32,19 @@ ICET_EXPORT IceTVoid *icetImageGetColorVoid(IceTImage image,
IceTSizeType *pixel_size);
ICET_EXPORT IceTVoid *icetImageGetDepthVoid(IceTImage image,
IceTSizeType *pixel_size);
ICET_EXPORT IceTBoolean icetImageEqual(const IceTImage image1,
const IceTImage image2);
ICET_EXPORT void icetImageCopyPixels(const IceTImage in_image,
IceTSizeType in_offset,
IceTImage out_image,
IceTSizeType out_offset,
IceTSizeType num_pixels);
ICET_EXPORT void icetImageCopyRegion(const IceTImage in_image,
const IceTInt *in_viewport,
IceTImage out_image,
const IceTInt *out_viewport);
ICET_EXPORT void icetImageClearAroundRegion(IceTImage image,
const IceTInt *region);
ICET_EXPORT void icetImagePackageForSend(IceTImage image,
IceTVoid **buffer,
IceTSizeType *size);
......
......@@ -43,7 +43,7 @@ static int BlankTilesRun()
glClearColor(0.0, 0.0, 0.0, 0.0);
icetDrawFunc(draw);
icetGLDrawCallback(draw);
icetBoundingBoxf(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);
icetSetColorFormat(ICET_IMAGE_COLOR_RGBA_UBYTE);
......
......@@ -50,7 +50,7 @@ static int BoundsBehindViewerRun()
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
icetDrawFunc(draw);
icetGLDrawCallback(draw);
icetStrategy(ICET_STRATEGY_REDUCE);
icetBoundingBoxf(-1.0, 1.0, -1.0, 1.0, -0.0, 0.0);
......
......@@ -232,7 +232,7 @@ static int DoCompressionTest(IceTEnum color_format, IceTEnum depth_format,
printf("\nSetup for actual render.\n");
icetResetTiles();
icetAddTile(viewport[0], viewport[1], viewport[2], viewport[3], 0);
icetDrawFunc(draw);
icetGLDrawCallback(draw);
/* Do a perfunctory draw to set other state variables. */
icetGLDrawFrame();
icetStateSetIntegerv(ICET_CONTAINED_VIEWPORT, 4, viewport);
......
......@@ -62,7 +62,7 @@ static int DisplayNoDrawRun()
icetResetTiles();
icetAddTile(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
icetDrawFunc(draw);
icetGLDrawCallback(draw);
icetSetColorFormat(ICET_IMAGE_COLOR_RGBA_UBYTE);
icetSetDepthFormat(ICET_IMAGE_DEPTH_FLOAT);
......
......@@ -327,7 +327,7 @@ static int RandomTransformRun()
}
/* Set up ICE-T. */
icetDrawFunc(draw);
icetGLDrawCallback(draw);
icetBoundingBoxf(-1.0, 1.0, -1.0, 1.0, -0.125, 0.125);
icetEnable(ICET_CORRECT_COLORED_BACKGROUND);
......
......@@ -78,7 +78,7 @@ static int SimpleExampleRun()
glClearColor(0.2f, 0.5f, 0.1f, 1.0f);
/* Give ICE-T a function that will issue the OpenGL drawing commands. */
icetDrawFunc(draw);
icetGLDrawCallback(draw);
/* Give ICE-T the bounds of the polygons that will be drawn. Note that
* we must take into account any transformation that happens within the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment