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