My Project: openb3dlib.mod/openb3d/src/texture.h Source File

My Project

texture.h
Go to the documentation of this file.
1 #ifndef TEXTURE_H
2 #define TEXTURE_H
3
4 /*
5 * texture.h
6 * iminib3d
7 *
8 * Created by Simon Harrison.
9 * Copyright Si Design. All rights reserved.
10 *
11 */
12
13 //#import "Texture2D.h"
14
15 #include <list>
16 #include <string>
17 #include <iostream>
18
19 using namespace std;
20
21 class Camera;
22
23 class Texture{
24
25 public:
26
27 unsigned int texture;
28
29 static list<Texture*> tex_list;
30
31 string file;
32 unsigned int* frames;
33
34 int flags,blend,coords;
35 float u_scale,v_scale,u_pos,v_pos,angle;
36 string file_abs;
37 int width,height; // returned by Name/Width/Height commands
38 int no_frames;
39 unsigned int* framebuffer;
40 int cube_face,cube_mode;
41
42 int glTexEnv[3][12];//
43 int glTexEnv_count;//
44
45 Texture(){
46
47 //texture=NULL;
48 file="";
49 flags=0,blend=2,coords=0;
50 u_scale=1.0,v_scale=1.0,u_pos=0.0,v_pos=0.0,angle=0.0;
51 string file_abs="";
52 width=0,height=0; // returned by Name/Width/Height commands
53 no_frames=1;
54 framebuffer=0;
55 cube_face=0,cube_mode=1;
56
57 glTexEnv_count=0;//
58
59 };
60
61 static Texture* LoadTexture(string filename,int flags=0);
62 static Texture* LoadAnimTexture(string filename,int flags=0, int frame_width=0,int frame_height=0,int first_frame=0,int frame_count=1);
63 static Texture* CreateTexture(int width=256,int height=256,int flags=3, int frames=0);
64
65 Texture* Copy();
66 void FreeTexture();
67 void DrawTexture(int x,int y);
68 void TextureBlend(int blend_no);
69 void TextureCoords(int coords_no);
70 void ScaleTexture(float u_s,float v_s);
71 void PositionTexture(float u_p,float v_p);
72 void RotateTexture(float ang);
73 void BufferToTex(unsigned char* buffer, int frames=0);
74 void TexToBuffer(unsigned char* buffer, int frames=0);
75 void BackBufferToTex(int frames=0);
76 void CameraToTex(Camera* cam, int frames=0);
77 void DepthBufferToTex(Camera* cam);
78 string TextureName();
79 static void ClearTextureFilters();
80 static void AddTextureFilter(string text_match,int flags);
81 Texture* TexInList();
82 void FilterFlags();
83 //static string Strip(string filename);
84 };
85
86 #endif
Texture::frames
unsigned int * frames
Definition: texture.h:32
Texture::texture
unsigned int texture
Definition: texture.h:27
Texture::v_scale
float v_scale
Definition: texture.h:35
RotateTexture
void RotateTexture(Texture *tex, float ang)
Definition: functions.cpp:1346
TextureName
const char * TextureName(Texture *tex)
Definition: functions.cpp:1526
BackBufferToTex
void BackBufferToTex(Texture *tex, int frame)
Definition: functions.cpp:68
std
Camera
Definition: camera.h:23
ClearTextureFilters
void ClearTextureFilters()
Definition: functions.cpp:316
Texture::width
int width
Definition: texture.h:37
DepthBufferToTex
void DepthBufferToTex(Texture *tex, Camera *cam=0)
Definition: functions.cpp:2015
Texture::file
string file
Definition: texture.h:31
Texture::framebuffer
unsigned int * framebuffer
Definition: texture.h:39
TexInList
Texture * TexInList(Texture *obj)
Definition: methods.cpp:464
ScaleTexture
void ScaleTexture(Texture *tex, float u_scale, float v_scale)
Definition: functions.cpp:1374
Texture::Texture
Texture()
Definition: texture.h:45
Texture::cube_mode
int cube_mode
Definition: texture.h:40
Texture::file_abs
string file_abs
Definition: texture.h:36
LoadAnimTexture
Texture * LoadAnimTexture(char *file, int flags, int frame_width, int frame_height, int first_frame, int frame_count)
Definition: functions.cpp:1034
Texture::flags
int flags
Definition: texture.h:34
Texture::glTexEnv_count
int glTexEnv_count
Definition: texture.h:43
Texture
Definition: texture.h:23
PositionTexture
void PositionTexture(Texture *tex, float u_pos, float v_pos)
Definition: functions.cpp:1271
Texture::tex_list
static list< Texture * > tex_list
Definition: texture.h:29
FilterFlags
void FilterFlags(Texture *obj)
Definition: methods.cpp:468
TexToBuffer
void TexToBuffer(Texture *tex, unsigned char *buffer, int frame)
Definition: functions.cpp:76
Texture::no_frames
int no_frames
Definition: texture.h:38
TextureCoords
void TextureCoords(Texture *tex, int coords)
Definition: functions.cpp:1505
CameraToTex
void CameraToTex(Texture *tex, Camera *cam, int frame)
Definition: functions.cpp:72
CreateTexture
Texture * CreateTexture(int width, int height, int flags, int frames)
Definition: functions.cpp:581
BufferToTex
void BufferToTex(Texture *tex, unsigned char *buffer, int frame)
Definition: functions.cpp:64
TextureBlend
void TextureBlend(Texture *tex, int blend)
Definition: functions.cpp:1498
FreeTexture
void FreeTexture(Texture *tex)
Definition: functions.cpp:898
LoadTexture
Texture * LoadTexture(char *file, int flags)
Definition: functions.cpp:1065