view TaskManager/Test/test_render/spe/DrawSpan.h @ 128:776eca0daa02

texture load use hash table
author gongo@charles.cr.ie.u-ryukyu.ac.jp
date Tue, 25 Nov 2008 15:52:28 +0900
parents 5c194c71eca8
children 805d27efafd8
line wrap: on
line source

#ifndef INCLUDED_TASK_DRAW_SPAN
#define INCLUDED_TASK_DRAW_SPAN

#ifndef INCLUDED_SCHED_TASK
#  include "SchedTask.h"
#endif

typedef int8_t          Sint8;
typedef uint8_t         Uint8;
typedef int16_t         Sint16;
typedef uint16_t        Uint16;
typedef int32_t         Sint32;
typedef uint32_t        Uint32;
typedef unsigned short  GLushort;

typedef struct {
    uint32 pixel[64]; // 8*8
    void *texture_addr;
    int pad[3];
} Tile, *TilePtr;

#define MAX_TILE 100

typedef struct {
    int size;
    int pad[3];
    Tile tile[MAX_TILE];

    void init(void) {
	size = 0;
    }
} TileList, *TileListPtr;

class DrawSpan : public SchedTask {
public:
    SchedConstructor(DrawSpan);

    int run(void *rbuf, void *wbuf);

    float* zRow_init(int w, int h);
    void linebuf_init(int *buf, int width, int rgb);
    
    char* get_pixel(int tx, int ty, void *texture_image);
    Uint32 get_rgb(int tx, int ty, void *texture);
};

#endif