~bregma/ucube/trunk

« back to all changes in this revision

Viewing changes to ucube/image.h

  • Committer: Stephen M. Webb
  • Date: 2010-09-29 14:08:49 UTC
  • Revision ID: stephen.webb@canonical.com-20100929140849-1dev2tf7zk0iibor
Added support for image loading.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file ucube/image.cpp
 
3
 * @brief Implemntation of the ucube image module.
 
4
 *
 
5
 * Copyright 2010 Stephen M. Webb  <stephen.webb@canonical.com>
 
6
 *
 
7
 * This propgram is free software; you can redistribute it and/or modify it under
 
8
 * the terms of the GNU General Public License as published by the Free Software
 
9
 * Foundation; either version 3 of the License, or (at your option) any later
 
10
 * version.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful, but WITHOUT
 
13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
14
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 
15
 * details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along with
 
18
 * this program; if not, write to the Free Software Foundation, Inc., 51
 
19
 * Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
20
 */
 
21
#ifndef INCLUDE_UCUBE_IMAGE_H_
 
22
#define INCLUDE_UCUBE_IMAGE_H_
 
23
 
 
24
#include <string>
 
25
#include <GL/glew.h>
 
26
 
 
27
namespace UCube
 
28
{
 
29
  /**
 
30
   * Encapsulates a image.
 
31
   */
 
32
  class Image
 
33
  {
 
34
  public:
 
35
    /** @brief Loads the image image and creates the OpenGL textures. */
 
36
    Image(const std::string& name);
 
37
 
 
38
    /** @brief Disposes of the image. */
 
39
    ~Image();
 
40
 
 
41
    GLuint texture() const;
 
42
 
 
43
  private:
 
44
    GLuint m_texture;
 
45
};
 
46
 
 
47
 
 
48
  inline GLuint Image::
 
49
  texture() const
 
50
  { return m_texture; }
 
51
 
 
52
} // namespace UCube
 
53
 
 
54
#endif // INCLUDE_UCUBE_IMAGE_H_
 
55