source: golgotha/src/render/r1_vert.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.7 KB
RevLine 
[80]1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef R1_VERT_HH
10#define R1_VERT_HH
11
12#include "arch.hh"
13#include "math/num_type.hh"
14#include "math/point.hh"
15
16// when calling a render_api's function, you need only specify r1_vert parameters
17// that will actually be used.  i.e. if you have alpha off, you do not need to specify a
18
19class r1_3d_point_class : public i4_3d_vector
20{
21public: 
22  float pad;
23};
24
25typedef struct //dont reorder this stuff
26{
27  r1_3d_point_class v;          // 3d position (not used for rendering)
28 
29  float px, py,         // projected x & y
30    s,t,                // texture coordinates 0..1
31    r,g,b,              // shading values, if white light mode r acts at white
32    a,                  // alpha  0..1
33    w;                  // 1/z      used for w-buffering and perspective correct tmapping   
34
35  w8 outcode;           // used for clipping (calculated by r1_full_clip)
36  w8 pad0;
37  w8 pad1;
38  w8 pad2; //pad so its 8 bytes
39
40  void set_color(i4_float _r, i4_float _g, i4_float _b, i4_float _a=1.) { r=_r; g=_g; b=_b; a=_a; }
41  void set_st(i4_float _s, i4_float _t) { s=_s; t=_t; }
42
43  i4_3d_point_class *point() { return (i4_3d_point_class *)&v; }
44  // creates a pointer to a i4_3d_point_class that represents the
45  // same values in v
46} r1_vert;
47
48#endif
Note: See TracBrowser for help on using the repository browser.