Restructure project sources.

This commit is contained in:
2018-03-26 12:17:52 +02:00
parent a206f81eb2
commit 8015b84311
41 changed files with 2 additions and 37 deletions

45
src/fmri/Texture.hpp Normal file
View File

@@ -0,0 +1,45 @@
#pragma once
#include <GL/gl.h>
namespace fmri
{
/**
* Simple owning Texture class.
*
* Encapsulates an OpenGL texture, and enables RAII for it. Copying
* is disallowed for this reason.
*/
class Texture
{
public:
/**
* Allocate a new texture
*/
Texture() noexcept;
Texture(Texture &&) noexcept;
Texture(const Texture &) = delete;
/**
* Own an existing texture
* @param id original texture ID.
*/
explicit Texture(GLuint id) noexcept;
~Texture();
Texture &operator=(Texture &&) noexcept;
Texture &operator=(const Texture &) = delete;
/**
* Bind the owned texture to the given spot.
* @param target valid target for glBindTexture.
*/
void bind(GLenum target) const;
void configure(GLenum target) const;
private:
GLuint id;
};
}