]>
Dogcows Code - chaz/yoink/blob - src/moof/image.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
12 #ifndef _MOOF_IMAGE_HH_
13 #define _MOOF_IMAGE_HH_
17 * Defines classes for loading and manipulating images.
20 #include <boost/noncopyable.hpp>
22 #include <moof/dispatcher.hh>
23 #include <moof/math.hh>
24 #include <moof/resource.hh>
30 class image
: public boost::noncopyable
34 static const int no_tile
= -1;
37 explicit image(const std::string
& path
);
67 std::string
comment() const
72 const char* pixels() const
78 void set_as_icon() const;
82 * Calculate texture coordinates for a tile at a certain index. Tiles
83 * are indexed start with zero as the top-left tile and moving across,
85 * \param index The tile index.
86 * \param coords An array of scalars where the texture coordinates will
87 * be stored after this call. The first coordinate (u,v) will be in
88 * the first two places and so on until all four coordinates are
89 * stored, therefore requiring enough room for an array of eight
90 * scalars. The winding of the coordinates is always counter-clockwise
92 * \return True if index is valid, false otherwise.
94 bool tile_coordinates(int index
, scalar coords
[8]) const;
98 static void reset_binding();
103 void upload_to_gl() const;
104 void unload_from_gl() const;
105 void context_recreated();
106 void set_properties() const;
107 void set_texture_info(const std::string
& info
);
112 mutable unsigned object_
;
113 static unsigned global_object_
;
121 std::string comment_
;
123 unsigned min_filter_
;
124 unsigned mag_filter_
;
130 //mutable dispatcher::handle new_context_;
133 typedef resource_handle
<image
> image_handle
;
138 #endif // _MOOF_IMAGE_HH_
This page took 0.044984 seconds and 4 git commands to generate.