~kamalmostafa/ubuntu/lucid/pdp/fix-504941-ftbfs

« back to all changes in this revision

Viewing changes to opengl/include/pdp_texture.h

  • Committer: Bazaar Package Importer
  • Author(s): Guenter Geiger (Debian/GNU)
  • Date: 2005-03-15 22:21:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050315222105-1q287rsihmd9j1tb
Tags: 1:0.12.4-2
* fixed the hardcoded depends
* added 3dp library

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *   pdp system module - texture packet type
3
 
 *   Copyright (c) by Tom Schouten <pdp@zzz.kotnet.org>
4
 
 *
5
 
 *   This program is free software; you can redistribute it and/or modify
6
 
 *   it under the terms of the GNU General Public License as published by
7
 
 *   the Free Software Foundation; either version 2 of the License, or
8
 
 *   (at your option) any later version.
9
 
 *
10
 
 *   This program is distributed in the hope that it will be useful,
11
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *   GNU General Public License for more details.
14
 
 *
15
 
 *   You should have received a copy of the GNU General Public License
16
 
 *   along with this program; if not, write to the Free Software
17
 
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
 *
19
 
 */
20
 
 
21
 
#ifndef PDP_TEXTURE_H
22
 
#define PDP_TEXTURE_H
23
 
 
24
 
//#include <GL/gl.h>
25
 
//#include <GL/glu.h>
26
 
//#include <GL/glx.h>
27
 
//#include <GL/glut.h>
28
 
#include "pdp.h"
29
 
 
30
 
 
31
 
 
32
 
 
33
 
 
34
 
/* TEXTURE PACKET */
35
 
 
36
 
typedef struct
37
 
{
38
 
    u32 tex_obj;           /* gl texture object */
39
 
    s32 format;            /* texture format */
40
 
    u32 width;             /* dims */
41
 
    u32 height;
42
 
 
43
 
    u32 sub_width;         /* portion of texture used */
44
 
    u32 sub_height;
45
 
 
46
 
} t_texture;
47
 
 
48
 
#define PDP_TEXTURE         4  /* opengl texture object */
49
 
 
50
 
 
51
 
/* all symbols are C-style */
52
 
#ifdef __cplusplus
53
 
extern "C"
54
 
{
55
 
#endif
56
 
 
57
 
 
58
 
/* check if valid texture packet. all other methods assume packet is valid */
59
 
bool pdp_packet_texture_isvalid(int packet);
60
 
 
61
 
/* returns a pointer to the packet subheader whem the packet contains a texture */
62
 
/* try not to use the header directly, use clone and copy methods instead */
63
 
t_texture *pdp_packet_texture_info(int packet);
64
 
 
65
 
/* texture constructors */
66
 
int pdp_packet_new_texture(u32 width, u32 height, s32 format);      /* create a texture packet */
67
 
 
68
 
 
69
 
/* texture operators */
70
 
void pdp_packet_texture_make_current(int packet);               /* make a texture the current texture context */
71
 
u32 pdp_packet_texture_total_width(int packet);                 /* width of texture */
72
 
u32 pdp_packet_texture_total_height(int packet);                /* get heigth of texture */
73
 
u32 pdp_packet_texture_sub_width(int packet);                   /* width of subtexture */
74
 
u32 pdp_packet_texture_sub_height(int packet);                  /* heigth of subtexture */
75
 
float pdp_packet_texture_fracx(int packet);                     /* x fraction */
76
 
float pdp_packet_texture_fracy(int packet);                     /* y fraction */
77
 
float pdp_packet_texture_sub_aspect(int packet);
78
 
 
79
 
/* some utility methods */
80
 
void pdp_packet_texture_make_current_enable(int packet);        /* make current & enable with default texture settings (for the lazy)*/
81
 
void pdp_packet_texture_setup_2d_context(int packet);           /* set up 2d context (viewport, projection, modelview) from texture dims */
82
 
 
83
 
 
84
 
 
85
 
 
86
 
 
87
 
 
88
 
 
89
 
#ifdef __cplusplus
90
 
}
91
 
#endif
92
 
 
93
 
#endif //PDP_TEXTURE_H