GLSurfaceData Class Reference

#include <gl_surface_data.hpp>

Inherits SurfaceData.

List of all members.

Public Member Functions

 GLSurfaceData (const Surface &surface)
float get_uv_left () const
float get_uv_top () const
float get_uv_right () const
float get_uv_bottom () const

Private Attributes

const Surfacesurface
float uv_left
float uv_top
float uv_right
float uv_bottom


Detailed Description

Definition at line 23 of file gl_surface_data.hpp.


Constructor & Destructor Documentation

GLSurfaceData::GLSurfaceData ( const Surface surface  )  [inline]

Definition at line 33 of file gl_surface_data.hpp.

00033                                         :
00034     surface(surface),
00035     uv_left((float) surface.get_x() / surface.get_texture()->get_texture_width()),
00036     uv_top((float) surface.get_y() / surface.get_texture()->get_texture_height()),
00037     uv_right((float) (surface.get_x() + surface.get_width()) / surface.get_texture()->get_texture_width()),
00038     uv_bottom((float) (surface.get_y() + surface.get_height()) / surface.get_texture()->get_texture_height())
00039   {
00040   }


Member Function Documentation

float GLSurfaceData::get_uv_left (  )  const [inline]

Definition at line 42 of file gl_surface_data.hpp.

References Surface::get_flipx(), surface, uv_left, and uv_right.

Referenced by GLRenderer::draw_surface(), GLLightmap::draw_surface(), GLRenderer::draw_surface_part(), and GLLightmap::draw_surface_part().

00043   {
00044     return surface.get_flipx() ? uv_right : uv_left;
00045   }

float GLSurfaceData::get_uv_top (  )  const [inline]

Definition at line 47 of file gl_surface_data.hpp.

References uv_top.

Referenced by GLRenderer::draw_surface(), GLLightmap::draw_surface(), GLRenderer::draw_surface_part(), and GLLightmap::draw_surface_part().

00048   {
00049     return uv_top;
00050   }

float GLSurfaceData::get_uv_right (  )  const [inline]

Definition at line 52 of file gl_surface_data.hpp.

References Surface::get_flipx(), surface, uv_left, and uv_right.

Referenced by GLRenderer::draw_surface(), GLLightmap::draw_surface(), GLRenderer::draw_surface_part(), and GLLightmap::draw_surface_part().

00053   {
00054     return surface.get_flipx() ? uv_left : uv_right;
00055   }

float GLSurfaceData::get_uv_bottom (  )  const [inline]

Definition at line 57 of file gl_surface_data.hpp.

References uv_bottom.

Referenced by GLRenderer::draw_surface(), GLLightmap::draw_surface(), GLRenderer::draw_surface_part(), and GLLightmap::draw_surface_part().

00058   {
00059     return uv_bottom;
00060   }


Member Data Documentation

const Surface& GLSurfaceData::surface [private]

Definition at line 26 of file gl_surface_data.hpp.

Referenced by get_uv_left(), and get_uv_right().

float GLSurfaceData::uv_left [private]

Definition at line 27 of file gl_surface_data.hpp.

Referenced by get_uv_left(), and get_uv_right().

float GLSurfaceData::uv_top [private]

Definition at line 28 of file gl_surface_data.hpp.

Referenced by get_uv_top().

float GLSurfaceData::uv_right [private]

Definition at line 29 of file gl_surface_data.hpp.

Referenced by get_uv_left(), and get_uv_right().

float GLSurfaceData::uv_bottom [private]

Definition at line 30 of file gl_surface_data.hpp.

Referenced by get_uv_bottom().


The documentation for this class was generated from the following file:
Generated on Mon Jun 9 03:38:31 2014 for SuperTux by  doxygen 1.5.1