Documented EE::Graphics.

ePolygon2f::CreateRoundedPolygon is now ePolygon2f::CreateRoundedRectangle.
This commit is contained in:
Martín Lucas Golini
2013-01-20 01:46:15 -03:00
parent e57fa199c3
commit d628bb19ba
45 changed files with 340 additions and 104 deletions

View File

@@ -16,4 +16,6 @@ syntax: glob
./eees*
./eeew*
./eetest*
./docs
ee.tag
log.log

View File

@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Entropia Engine++"
PROJECT_NUMBER = 0.8
PROJECT_NUMBER = 0.9
OUTPUT_DIRECTORY = ./docs
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
@@ -96,7 +96,6 @@ WARN_LOGFILE =
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./include/eepp
./src/eepp
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
@@ -149,9 +148,7 @@ FILE_PATTERNS = *.c \
*.xpm \
*.dox
RECURSIVE = YES
EXCLUDE = ./include/eepp/helper/ \
./src/eepp/helper/
EXCLUDE = ./include/eepp/helper
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =

View File

@@ -9,7 +9,7 @@ namespace EE { namespace Audio {
class EE_API cSound {
public :
/** @enum Status The state of the sound */
/** @enum cSound::Status The state of the sound */
enum Status {
Stopped,
Paused,

View File

@@ -163,7 +163,7 @@ class EE_API String {
static void StrFormat( char * Buffer, int BufferSize, const char * format, ... );
/** @brief Construct from an UTF-8 string to UTF-32 according
** @param uf8String UTF-8 string to convert
** @param utf8String UTF-8 string to convert
**/
static String FromUtf8( const std::string& utf8String );
@@ -199,7 +199,7 @@ class EE_API String {
String( const char* uf8String );
/** @brief Construct from an UTF-8 string to UTF-32 according
** @param uf8String UTF-8 string to convert
** @param utf8String UTF-8 string to convert
**/
String( const std::string& utf8String );

View File

@@ -147,8 +147,7 @@ public :
///
/// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence
/// \param output Iterator pointing to the beginning of the output sequence
/// \param locale Locale to use for conversion
/// \param output Iterator pointing to the beginning of the output sequence
///
/// \return Iterator to the end of the output sequence which has been written
///
@@ -357,8 +356,7 @@ public :
///
/// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence
/// \param output Iterator pointing to the beginning of the output sequence
/// \param locale Locale to use for conversion
/// \param output Iterator pointing to the beginning of the output sequence
///
/// \return Iterator to the end of the output sequence which has been written
///
@@ -568,8 +566,7 @@ public :
///
/// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence
/// \param output Iterator pointing to the beginning of the output sequence
/// \param locale Locale to use for conversion
/// \param output Iterator pointing to the beginning of the output sequence
///
/// \return Iterator to the end of the output sequence which has been written
///

View File

@@ -32,7 +32,7 @@
STATE: EE ( Base ) documented what is needed.
EE::Window documented.
EE::System documented.
EE::Graphics 85 % commented.
EE::Graphics documented.
EE::Audio 50 % commented.
EE::Math 30 to 40 % commented.
EE::UI Not commented at all.

View File

@@ -86,16 +86,12 @@ class EE_API cConsole : protected iLogReader {
/** @return The fading speed in ms */
eeFloat FadeSpeed() const { return mFadeSpeed; }
/** Creates the new console
/** @brief Creates the new console
* @param Font The cFont pointer to class
* @param MakeDefaultCommands Register the default commands provided by the class?
* @param AttachToLog Attach the console to the cLog instance
* @param MaxLogLines Maximun number of lines stored on the console
* @param Background texture ( 0 if don't want a texture )
* @param ConsoleColor The Console Background Color
* @param ConsoleLineColor The Console Line Background Color
* @param FontColor The Console Font Color
* @param FontLineColor The Console Line Font Color ( The Client Input )
* @param TextureId Background texture id ( 0 for no texture )
*/
void Create( cFont* Font, const bool& MakeDefaultCommands = true, const bool& AttachToLog = true, const eeUint& MaxLogLines = 1024, const Uint32& TextureId = 0 );

View File

@@ -15,7 +15,6 @@ class EE_API cFont {
/** Set a text to render
* @param Text The Text
* @param SupportNewLine If active will search for "\n" and back to a new line.
*/
void SetText( const String& Text );

View File

@@ -43,7 +43,7 @@ class EE_API cFrameBuffer {
/** @return The frame buffer texture. Everything is rendered to this texture.
** To render the frame buffer you just need to draw the texture as any other texture.
** The frame buffer must be unbinded before any rendering is done outside the frame buffer.
** @example MyFrameBufferPtr->GetTexture()->Draw(0,0);
** For example MyFrameBufferPtr->GetTexture()->Draw(0,0);
*/
cTexture * GetTexture() const;

View File

@@ -22,7 +22,7 @@ class EE_API cScrollParallax {
* @param Size The size of the parallax
* @param Speed Speed of movement ( in Pixels Per Second )
* @param Color The Texture Color
* @param Effect The Blend Mode ( default ALPHA_NORMAL ) */
* @param Blend The Blend Mode ( default ALPHA_NORMAL ) */
cScrollParallax( cSubTexture * SubTexture, const eeVector2f& Position = eeVector2f(), const eeSizef& Size = eeSizef(), const eeVector2f& Speed = eeVector2f(), const eeColorA& Color = eeColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
/** Create's the Scroll Parallax
@@ -31,7 +31,7 @@ class EE_API cScrollParallax {
* @param Size The size of the parallax
* @param Speed Speed of movement ( in Pixels Per Second )
* @param Color The Texture Color
* @param Effect The Blend Mode ( default ALPHA_NORMAL )
* @param Blend The Blend Mode ( default ALPHA_NORMAL )
* @return True if success
*/
bool Create( cSubTexture * SubTexture, const eeVector2f& Position = eeVector2f(), const eeSizef& Size = eeSizef(), const eeVector2f& Speed = eeVector2f(), const eeColorA& Color = eeColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );

View File

@@ -13,7 +13,7 @@ class EE_API cSprite {
public:
typedef cb::Callback2< void, Uint32, cSprite * > SpriteCallback;
/** @enum The events that can be reported by the Sprite */
/** @enum cSprite::SpriteEvents The events that can be reported by the Sprite */
enum SpriteEvents {
SPRITE_EVENT_LAST_FRAME,
SPRITE_EVENT_FIRST_FRAME,
@@ -24,10 +24,10 @@ class EE_API cSprite {
cSprite();
/** Creates an animated Sprite from a animation name. It will search for a pattern name.
* For example search for name "car" with extensions "png", i will try to find car00.png car01.png car02.png, and so on, it will continue if find something, otherwise it will stop ( it will always search at least for car00.png and car01.png ).
* @param name First part of the sub texture name
* @param extension Extension of the sub texture name ( if have one, otherwise is empty )
* @param SearchInTextureAtlas If you want only to search in a especific atlas ( NULL if you want to search in all atlases )
* @example Search for name "car" with extensions "png", i will try to find car00.png car01.png car02.png, and so on, it will continue if find something, otherwise it will stop ( it will always search at least for car00.png and car01.png ).
* @note Texture atlases saves the SubTextures names without extension by default.
* @see cTextureAtlasManager::GetSubTexturesByPattern
*/

View File

@@ -8,7 +8,7 @@ namespace EE { namespace Graphics {
class cFont;
/** @brief Cached text for a fast font rendering. */
/** @brief Caches text for a fast font rendering. */
class EE_API cTextCache {
public:
cTextCache( cFont * font, const String& text = "", eeColorA FontColor = eeColorA(255,255,255,255), eeColorA FontShadowColor = eeColorA(0,0,0,255) );
@@ -48,9 +48,9 @@ class EE_API cTextCache {
void Color(const eeColorA& color);
/** Set the color of the substring
* @Color The color
* @from The first char to change the color
* @to The last char to change the color
* @param color The color
* @param from The first char to change the color
* @param to The last char to change the color
*/
void Color(const eeColorA& color, Uint32 from, Uint32 to );

View File

@@ -108,26 +108,24 @@ class EE_API cTexture : public cImage {
* @param Angle The Angle of the texture rendered
* @param Scale The Scale factor of the rendered texture
* @param Color The texture color
* @param blend Set the Blend Mode ( default ALPHA_NORMAL )
* @param Blend Set the Blend Mode ( default ALPHA_NORMAL )
* @param width The width of the texture rendered
* @param height The height of the texture rendered
*/
void DrawFast( const eeFloat& x, const eeFloat& y, const eeFloat& Angle = 0.0f, const eeFloat& Scale = 1.0f, const eeColorA& Color = eeColorA(), const EE_BLEND_MODE &blend = ALPHA_NORMAL, const eeFloat &width = 0, const eeFloat &height = 0 );
void DrawFast( const eeFloat& x, const eeFloat& y, const eeFloat& Angle = 0.0f, const eeFloat& Scale = 1.0f, const eeColorA& Color = eeColorA(), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const eeFloat &width = 0, const eeFloat &height = 0 );
/** Render the texture on screen
* @param x The x position on screen
* @param y The y position on screen
* @param width The width of the texture rendered ( when Scale = 1, otherwise this width will be scaled like width * Scale )
* @param height The height of the texture rendered ( when Scale = 1, otherwise this height will be scaled like height * Scale )
* @param Angle The Angle of the texture rendered
* @param Scale The Scale factor of the rendered texture
* @param Color The texture color
* @param blend Set the Blend Mode ( default ALPHA_NORMAL )
* @param Blend Set the Blend Mode ( default ALPHA_NORMAL )
* @param Effect Set the Render Effect ( default RN_NORMAL, no effect )
* @param ScaleCentered If true the texture will be scaled centered, otherwise will be scale from the Top - Left Corner
* @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture )
*/
void Draw( const eeFloat &x, const eeFloat &y, const eeFloat &Angle = 0, const eeFloat &Scale = 1.0f, const eeColorA& Color = eeColorA(255,255,255,255), const EE_BLEND_MODE &blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, const bool &ScaleCentered = true, const eeRecti& texSector = eeRecti(0,0,0,0) );
void Draw( const eeFloat &x, const eeFloat &y, const eeFloat &Angle = 0, const eeFloat &Scale = 1.0f, const eeColorA& Color = eeColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, const bool &ScaleCentered = true, const eeRecti& texSector = eeRecti(0,0,0,0) );
/** Render the texture on screen. Extended because can set the vertex colors individually
* @param x The x position on screen
@@ -208,20 +206,6 @@ class EE_API cTexture : public cImage {
cTexture( const cTexture& Copy );
/** Create the Texture
* @param texture The OpenGL Texture Id (texture handler)
* @param width The Texture Width
* @param height The Texture Height
* @param imgwidth The Image Width
* @param imgheight The Image Height
* @param UseMipmap Set if Texture has Mipmaps
* @param Channels The Texture number of channels.
* @param filepath The Texture File path
* @param ColorKey The Texture Color Key
* @param ClampMode The Texture Clamp Mode
* @param CompressedTexture The Texture was compressed on loading
* @param data The Texture (raw texture)
*/
void Create( const Uint32& texture, const eeUint& width, const eeUint& height, const eeUint& imgwidth, const eeUint& imgheight, const bool& UseMipmap, const eeUint& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize = 0, const Uint8* data = NULL );
std::string mFilepath;

View File

@@ -43,7 +43,7 @@ class EE_API cTextureAtlasLoader {
/** Loads a texture atlas from a pack file.
* If the loader is not threaded, it will load the atlas immediately.
* @param Pack The pointer of the pack instance to be used to load the file.
* @param FilePathPath The path of the file inside the pack.
* @param FilePackPath The path of the file inside the pack.
* @param Threaded Indicates if the loading is done in another thread.
* @param LoadCallback The load notification callback.
*/
@@ -85,7 +85,7 @@ class EE_API cTextureAtlasLoader {
/** Loads a texture atlas from a pack file.
* If the loader is not threaded, it will load the atlas immediately.
* @param Pack The pointer of the pack instance to be used to load the file.
* @param FilePathPath The path of the file inside the pack.
* @param FilePackPath The path of the file inside the pack.
*/
void LoadFromPack( cPack * Pack, const std::string& FilePackPath );

View File

@@ -36,10 +36,10 @@ class EE_API cTextureAtlasManager : public tResourceManager<cTextureAtlas> {
cSubTexture * GetSubTextureById( const Uint32& Id );
/** Search for a pattern name
* For example search for name "car" with extensions "png", i will try to find car00.png car01.png car02.png, and so on, it will continue if find something, otherwise it will stop ( it will always search at least for car00.png and car01.png )
* @param name First part of the sub texture name
* @param extension Extension of the sub texture name ( if have one, otherwise is empty )
* @param SearchInTextureAtlas If you want only to search in a especific atlas ( NULL if you want to search in all atlases )
* @example Search for name "car" with extensions "png", i will try to find car00.png car01.png car02.png, and so on, it will continue if find something, otherwise it will stop ( it will always search at least for car00.png and car01.png )
* @note Texture atlases saves the SubTextures names without extension by default.
*/
std::vector<cSubTexture*> GetSubTexturesByPattern( const std::string& name, const std::string& extension = "", cTextureAtlas * SearchInTextureAtlas = NULL );

View File

@@ -18,7 +18,7 @@ class EE_API cTextureFactory : protected cMutex {
* @param Height Texture Height
* @param Channels Texture Number of Channels (in bytes)
* @param DefaultColor The background color for the texture
* @param mipmap Create Mipmap?
* @param Mipmap Create Mipmap?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
@@ -40,7 +40,7 @@ class EE_API cTextureFactory : protected cMutex {
*/
Uint32 LoadFromPixels( const unsigned char * Pixels, const eeUint& Width, const eeUint& Height, const eeUint& Channels, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false, const std::string& FileName = std::string("") );
/** Load a texture from Pack
/** Load a texture from Pack file
* @param Pack Pointer to the pack instance
* @param FilePackPath The path of the file inside the pack
* @param Mipmap Create Mipmap?
@@ -51,7 +51,7 @@ class EE_API cTextureFactory : protected cMutex {
*/
Uint32 LoadFromPack( cPack* Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Load a texture from memory (RGBA Format)
/** Load a texture from memory
* @param ImagePtr The image data in RAM just as if it were still in a file
* @param Size The size of the texture ( Width * Height * BytesPerPixel )
* @param Mipmap Use mipmaps?
@@ -64,23 +64,23 @@ class EE_API cTextureFactory : protected cMutex {
/** Load a Texture from stream
* @param Stream The cIOStream instance
* @param mipmap Use mipmaps?
* @param Mipmap Use mipmaps?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
* @return The internal Texture Id
*/
Uint32 LoadFromStream( cIOStream& Stream, const bool& mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
Uint32 LoadFromStream( cIOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Load a Texture from a file path
* @param filepath The path for the texture
* @param mipmap Use mipmaps?
* @param Filepath The path for the texture
* @param Mipmap Use mipmaps?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
* @return The internal Texture Id
*/
Uint32 Load( const std::string& Filepath, const bool& mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
Uint32 Load( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Remove and Unload the Texture Id
* @param TexId
@@ -174,7 +174,6 @@ class EE_API cTextureFactory : protected cMutex {
* @param ImgHeight Image Height
* @param Mipmap Tell if the texture has mipmaps
* @param Channels Texture number of Channels ( bytes per pixel )
* @param ColorKey The transparent color key for the texture
* @param ClampMode The Texture Clamp Mode
* @param CompressTexture The texture is compressed?
* @param LocalCopy If keep a local copy in memory of the texture

View File

@@ -47,7 +47,7 @@ class EE_API cTextureFont : public cFont {
/** Load's a texture font and then load's the character coordinates file previously loaded on memory ( generated by the cTTFFont class )
* @param TexId The texture id returned by cTextureFactory
* @param CoordinatesDatPath The character coordinates file
* @param CoordData The character coordinates buffer pointer
* @param CoordDataSize The size of CoordData
* @param VerticalDraw If true render the string verticaly
* @return True if success

View File

@@ -9,24 +9,61 @@
namespace EE { namespace Graphics {
/** @brief The Texture Font loads a texture font in synchronous or asynchronous mode.
@see cObjectLoader */
class EE_API cTextureFontLoader : public cObjectLoader {
public:
/** Loads a texture font from a texture ( only for monospaced fonts )
* @param FontName The font name
* @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed.
* @param StartChar The fist char represented on the texture
* @param Spacing The space between every char ( default 0 means TextureWidth / TexColumns )
* @param VerticalDraw If true render the string verticaly
* @param TexColumns The number of chars per column
* @param TexRows The number of chars per row
* @param NumChars The number of characters to read from the texture
*/
cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const eeUint& StartChar = 0, const eeUint& Spacing = 0, const bool& VerticalDraw = false, const eeUint& TexColumns = 16, const eeUint& TexRows = 16, const Uint16& NumChars = 256 );
/** Load's a texture font and then load's the character coordinates file ( generated by the cTTFFont class )
* @param FontName The font name
* @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed.
* @param CoordinatesDatPath The character coordinates file ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ).
* @param VerticalDraw If true render the string verticaly
*/
cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const std::string& CoordinatesDatPath, const bool& VerticalDraw = false );
/** Load's a texture font and then load's the character coordinates file ( generated by the cTTFFont class ) stored in a pack file.
* @param FontName The font name
* @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed.
* @param Pack The pack used to load the characters coordinates
* @param FilePackPath The character coordinates file path inside the pack ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ).
* @param VerticalDraw If true render the string verticaly
*/
cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, cPack * Pack, const std::string& FilePackPath, const bool& VerticalDraw = false );
/** Load's a texture font and then load's the character coordinates file ( generated by the cTTFFont class ) from memory.
* @param FontName The font name
* @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed.
* @param CoordData The character coordinates buffer pointer ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ).
* @param CoordDataSize The buffer pointer size
* @param VerticalDraw If true render the string verticaly
*/
cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const char* CoordData, const Uint32& CoordDataSize, const bool& VerticalDraw = false );
virtual ~cTextureFontLoader();
/** Updates the current state of the loading in progress ( must be called from the instancer thread, usually the main thread ).
* @see cObjectLoader::Update */
void Update();
/** @brief Releases the font loaded ( if was already loaded ) */
void Unload();
/** @return The font name */
const std::string& Id() const;
/** @return The instance of the font created after loading it. ( NULL if was not created yet ) */
cFont * Font() const;
protected:
enum TEXTURE_FONT_LOAD_TYPE

View File

@@ -8,30 +8,82 @@ namespace EE { namespace Graphics {
class cTexture;
/** @brief The Texture loader loads a texture in synchronous or asynchronous mode.
@see cObjectLoader
*/
class EE_API cTextureLoader : public cObjectLoader {
public:
/** Load a Texture from stream
* @param Stream The io stream instance
* @param Mipmap Use mipmaps?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
* @return The internal Texture Id
*/
cTextureLoader( cIOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Load a Texture from a file path
* @param Filepath The path for the texture
* @param Mipmap Use mipmaps?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
*/
cTextureLoader( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Load a texture from memory
* @param ImagePtr The image data in RAM just as if it were still in a file
* @param Size The size of the texture ( Width * Height * BytesPerPixel )
* @param Mipmap Use mipmaps?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
*/
cTextureLoader( const unsigned char * ImagePtr, const eeUint& Size, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Load a texture from a Pack file
* @param Pack Pointer to the pack instance
* @param FilePackPath The path of the file inside the pack
* @param Mipmap Create Mipmap?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
*/
cTextureLoader( cPack * Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false );
/** Loads a RAW Texture from Memory
* @param Pixels The Texture array
* @param Width Texture Width
* @param Height Texture Height
* @param Channels Texture Number of Channels (in bytes)
* @param Mipmap Create Mipmap?
* @param ClampMode Defines the CLAMP MODE
* @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 )
* @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture )
* @param FileName A filename to recognize the texture ( the path in case that was loaded from outside the texture factory ).
*/
cTextureLoader( const unsigned char * Pixels, const eeUint& Width, const eeUint& Height, const eeUint& Channels, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = EE_CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false, const std::string& FileName = std::string("") );
virtual ~cTextureLoader();
/** A color key can be set to be transparent in the texture. This must be set before the loading is done. */
void SetColorKey( eeColor Color );
/** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL context was created ( the main thread ).
** @see cObjectLoader::Update */
void Update();
/** @brief Releases the texture loaded ( if was already loaded ), it will destroy the texture from memory. */
void Unload();
/** @return The file path to the texture ( if any ) */
const std::string& Filepath() const;
/** @return The texture internal id */
const Uint32& Id() const;
/** @return The texture instance ( if it was loaded ). */
cTexture * GetTexture() const;
protected:
Uint32 mLoadType; // From memory, from path, from pack

View File

@@ -20,7 +20,7 @@ class EE_API cTTFFont : public cFont {
/** The destructor will not unload the texture from memory. If you want that you'll have to remove it manually ( cTextureFactory::instance()->Remove( MyFontInstance->GetTexId() ) ). */
virtual ~cTTFFont();
/** Load a True Type Font from path
/** Loads a True Type Font from path
* @param Filepath The TTF file path
* @param Size The Size Width and Height for the font.
* @param Style The Font Style
@@ -29,11 +29,12 @@ class EE_API cTTFFont : public cFont {
* @param FontColor The Font color (this is the texture font color, if you plan to use a custom color and use outline, set it )
* @param OutlineSize The Ouline Size
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
* @return If success
*/
bool Load( const std::string& Filepath, const eeUint& Size, EE_TTF_FONT_STYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
/** Load Font from pack
/** Loads a True Type Font from pack
* @param Pack Pointer to the pack instance
* @param FilePackPath The path of the file inside the pack
* @param Size The Size of the Font
@@ -43,11 +44,12 @@ class EE_API cTTFFont : public cFont {
* @param FontColor The Font color (this is the texture font color, if you plan to use a custom color and use outline, set it )
* @param OutlineSize The Ouline Size
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
* @return If success
*/
bool LoadFromPack( cPack* Pack, const std::string& FilePackPath, const eeUint& Size, EE_TTF_FONT_STYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
/** Load a True Type Font from memory
/** Loads a True Type Font from memory
* @param TTFData The pointer to the data
* @param TTFDataSize The size of the data
* @param Size The Size of the Font
@@ -57,6 +59,7 @@ class EE_API cTTFFont : public cFont {
* @param FontColor The Font color (this is the texture font color, if you plan to use a custom color and use outline, set it )
* @param OutlineSize The Ouline Size
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
* @return If success
*/
bool LoadFromMemory( Uint8* TTFData, const eeUint& TTFDataSize, const eeUint& Size, EE_TTF_FONT_STYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );

View File

@@ -8,22 +8,69 @@
namespace EE { namespace Graphics {
/** @brief The TTF Font loader loads a true type font to memory in synchronous or asynchronous mode.
@see cObjectLoader
*/
class EE_API cTTFFontLoader : public cObjectLoader {
public:
/** Load a True Type Font from path
* @param FontName The font name
* @param Filepath The TTF file path
* @param Size The Size Width and Height for the font.
* @param Style The Font Style
* @param VerticalDraw If draw in vertical instead of horizontal
* @param NumCharsToGen Determine the number of characters to generate ( from char 0 to ... x )
* @param FontColor The Font color (this is the texture font color, if you plan to use a custom color and use outline, set it )
* @param OutlineSize The Ouline Size
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
*/
cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const eeUint& Size, EE_TTF_FONT_STYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
/** Load a True Type Font from a Pack
* @param FontName The font name
* @param Pack Pointer to the pack instance
* @param FilePackPath The path of the file inside the pack
* @param Size The Size of the Font
* @param Style The Font Style
* @param VerticalDraw If draw in vertical instead of horizontal
* @param NumCharsToGen Determine the number of characters to generate ( from char 0 to ... x )
* @param FontColor The Font color (this is the texture font color, if you plan to use a custom color and use outline, set it )
* @param OutlineSize The Ouline Size
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
*/
cTTFFontLoader( const std::string& FontName, cPack * Pack, const std::string& FilePackPath, const eeUint& Size, EE_TTF_FONT_STYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
/** Loads a True Type Font from memory
* @param FontName The font name
* @param TTFData The pointer to the data
* @param TTFDataSize The size of the data
* @param Size The Size of the Font
* @param Style The Font Style
* @param VerticalDraw If draw in vertical instead of horizontal
* @param NumCharsToGen Determine the number of characters to generate ( from char 0 to ... x )
* @param FontColor The Font color (this is the texture font color, if you plan to use a custom color and use outline, set it )
* @param OutlineSize The Ouline Size
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
*/
cTTFFontLoader( const std::string& FontName, Uint8* TTFData, const eeUint& TTFDataSize, const eeUint& Size, EE_TTF_FONT_STYLE Style = EE_TTF_STYLE_NORMAL, const bool& VerticalDraw = false, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
virtual ~cTTFFontLoader();
/** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL Context was created ( the main thread ).
** The TTF Font creates texture from the data obtained from the true type file.
** @see cObjectLoader::Update */
void Update();
/** Releases the Font instance and the texture loaded ( if was already loaded ), it will destroy the font texture from memory */
void Unload();
/** @return The font name. */
const std::string& Id() const;
/** @return The font instance if already exists, otherwise returns NULL. */
cFont * Font() const;
protected:
enum TTF_LOAD_TYPE

View File

@@ -6,56 +6,114 @@
namespace EE { namespace Graphics {
/** @brief The vertex buffer class holds vertex data. The vertex position, colors, texture coordinates and indexes.
* This is useful to accelerate and encapsulate data. GPU VBOs are much faster because the data is in the GPU once is uploaded. eepp will try to use GPU VBOs if the GPU support them.
*/
class EE_API cVertexBuffer {
public:
/** @brief Creates a new Vertex Buffer.
* @param VertexFlags The vertex flags indicates which vertex data will be used. @see EE_VERTEX_FLAGS
* @param DrawType The type of the primitive to draw.
* @param ReserveVertexSize If the vertex size is known is possible to reserve the space in memory to avoid resizeing the array.
* @param ReserveIndexSize If the vertex size is known is possible to reserve the space in memory for the indices to avoid resizeing the array.
* @param UsageType This indicates the kind of usage VBO will have. It's only useful if VBO extensions are supported ( almost for sure that it's supported ). More information here: http://www.opengl.org/sdk/docs/man/xhtml/glBufferData.xml
*/
static cVertexBuffer * New( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, EE_DRAW_MODE DrawType = DM_QUADS, const Int32& ReserveVertexSize = 0, const Int32& ReserveIndexSize = 0, EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC );
virtual ~cVertexBuffer();
/** @brief Adds a vertex of the type indicated to the buffer
* @param Type Can be the position or texture coordinates.
* @param Vertex The vexter data */
void AddVertex( const Uint32& Type, const eeVector2f& Vertex );
/** @brief Adds a vertex position to the buffer
* @param Vertex The vexter data */
void AddVertex( const eeVector2f& Vertex );
/** @brief Adds a vertex texture coordinate.
* @param VertexCoord The vertex texture coordinate.
* @param TextureLevel Indicates the texture level if it's using multitextures.
*/
void AddVertexCoord( const eeVector2f& VertexCoord, const Uint32& TextureLevel = 0 );
/** @brief Adds a color to the buffer.
* @param Color The color value.
*/
void AddColor( const eeColorA& Color );
/** @brief Adds an index to the buffer.
* @param Index The index value.
*/
void AddIndex( const Uint32& Index );
/** @brief Resizes the array of the type indicated.
* @param Type The type must be one of the vertex flags ( EE_VERTEX_FLAGS ).
* @param Size The size to be resized
*/
void ResizeArray( const Uint32& Type, const Uint32& Size );
/** @brief Resizes the indices array.
* @param Size The new size
*/
void ResizeIndices( const Uint32& Size );
/** @return the pointer to the array of the type indicated.
* @param Type The type must be one of the vertex flags ( EE_VERTEX_FLAGS ). */
eeFloat * GetArray( const Uint32& Type );
/** @return The color array pointer. */
Uint8 * GetColorArray();
/** @return The indices array pointer. */
Uint32 * GetIndices();
/** @return The number of vertex added. */
Uint32 GetVertexCount();
/** @return The number of indexes added. */
Uint32 GetIndexCount();
/** @return The vector data of the type indicated.
* @param Type Can be the position or texture coordinates.
* @param Index The position in the buffer.
*/
eeVector2f GetVector2( const Uint32& Type, const Uint32& Index );
/** @return The color at the buffer position.
* @param Index The position in the buffer.
*/
eeColorA GetColor( const Uint32& Index );
/** @return The index at the buffer position.
* @param Index The position in the buffer.
*/
Uint32 GetIndex( const Uint32& Index );
/** @brief Sets the number of elements to draw. If not set, it will draw all the elements. */
void SetElementNum( Int32 Num );
/** @return The number of elements added. */
const Int32& GetElementNum() const;
/** @brief Activates the vertex buffer. */
virtual void Bind() = 0;
/** @brief Deactivates the vertex buffer. */
virtual void Unbind() = 0;
/** @brief Draw the vertex buffer. */
virtual void Draw() = 0;
/** @brief Compile the vertex buffer.
* After adding all the vertex buffer data Compile() must be called to upload the data to the GPU.
*/
virtual bool Compile() = 0;
/** @brief Update is used in the case of some data is modified and need to be reuploaded to the GPU. */
virtual void Update( const Uint32& Types, bool Indices ) = 0;
/** @brief Reupload all the data to the GPU. */
virtual void Reload() = 0;
protected:
Uint32 mVertexFlags;
@@ -74,3 +132,41 @@ class EE_API cVertexBuffer {
}}
#endif
/** @class EE::Graphics::cVertexBuffer
* @ingroup Graphics
*
* Some example usage of this class:
* @code
// Creates a rounded rectangle.
eePolygon2f Poly = eePolygon2f::CreateRoundedRectangle( 0, 0, 256, 50 );
cVertexBuffer * VBO = cVertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN );
if ( NULL != VBO ) {
// Upload the rounded rectangle data to the vertex buffer.
for ( Uint32 i = 0; i < Poly.Size(); i++ ) {
VBO->AddVertex( Poly[i] ); // Adds the vertex position
VBO->AddColor( eeColorA( 255, 255, 255, 255 ) ); // Adds the vertex color
}
// Compiles the buffered data
VBO->Compile();
}
// ... in the main loop draw the VBO
while ( win->Running() )
{
...
VBO->Bind(); // First must be binded.
VBO->Draw(); // Then rendered.
VBO->Unbind(); // Then unbinded to allow render other things.
...
win->Display()
}
* @endcode
*
**/

View File

@@ -6,7 +6,7 @@
namespace EE { namespace Graphics {
/** The Vertex Buffer OGL is the implementation of a Vertex Buffer without using the specific VBOs extensions from OpenGL.
* @see cVertexBuffer
@see cVertexBuffer
*/
class EE_API cVertexBufferOGL : public cVertexBuffer {
public:

View File

@@ -5,8 +5,9 @@
namespace EE { namespace Graphics {
/** @brief The Vertex Buffer VBO class is the implementation of a Vertex Buffer using the GPU's VBO.
/** @brief The Vertex Buffer VBO class is the implementation of a Vertex Buffer using the OpenGL VBOs.
@see cVertexBuffer
More information in http://en.wikipedia.org/wiki/Vertex_Buffer_Object
*/
class EE_API cVertexBufferVBO : public cVertexBuffer {
public:

View File

@@ -6,10 +6,10 @@
namespace EE { namespace Graphics {
/** Pixel Perfect Collition implementation.
* @param TexId_1 First Texture Id
* @param Tex1 First Texture Id
* @param x1 Screen X axis position for the first texture
* @param y1 Screen Y axis position for the first texture
* @param TexId_2 Second Texture Id
* @param Tex2 Second Texture Id
* @param x2 Screen X axis position for the second texture
* @param y2 Screen Y axis position for the second texture
* @param Tex1_SrcRECT The sector of the texture from TexId_1 that you are rendering, the sector you want to collide ( on cSprite the SprSrcRECT )
@@ -20,7 +20,7 @@ namespace EE { namespace Graphics {
bool EE_API PixelPerfectCollide( cTexture * Tex1, const eeUint& x1, const eeUint& y1, cTexture * Tex2, const eeUint& x2, const eeUint& y2, const eeRectu& Tex1_SrcRECT = eeRectu(0,0,0,0), const eeRectu& Tex2_SrcRECT = eeRectu(0,0,0,0) );
/** Pixel Perfect Collition implementation between texture and a point
* @param TexId_1 First Texture Id
* @param Tex First Texture Id
* @param x1 Screen X axis position for the first texture
* @param y1 Screen Y axis position for the first texture
* @param x2 Screen X axis position for the point on screen

View File

@@ -15,6 +15,12 @@ class cRendererGL;
class cRendererGL3;
class cRendererGLES2;
/** @brief This class is an abstraction of some OpenGL functionality.
* eepp have 3 different rendering pipelines: OpenGL 2, OpenGL 3 and OpenGL ES 2. This abstraction is to encapsulate this pipelines.
* eepp implements its own state machine to simulate fixed-pipeline commands with OpenGL 3 and OpenGL ES 2.
* Most of the commands can be found in the OpenGL documentation.
* This is only useful for advanced users that want some control of the OpenGL pipeline. It's mostly used internally by the engine.
*/
class EE_API cGL {
static cGL * ms_singleton;
public:

View File

@@ -11,13 +11,16 @@ enum EE_VBO_USAGE_TYPE
VBO_USAGE_TYPE_COUNT
};
#define VERTEX_FLAG_POSITION ( 0 )
#define VERTEX_FLAG_TEXTURE0 ( 1 )
#define VERTEX_FLAG_TEXTURE1 ( 2 )
#define VERTEX_FLAG_TEXTURE2 ( 3 )
#define VERTEX_FLAG_TEXTURE3 ( 4 )
#define VERTEX_FLAG_COLOR ( 5 )
#define VERTEX_FLAG_USE_INDICES ( 6 )
enum EE_VERTEX_FLAGS
{
VERTEX_FLAG_POSITION = 0,
VERTEX_FLAG_TEXTURE0 = 1,
VERTEX_FLAG_TEXTURE1 = 2,
VERTEX_FLAG_TEXTURE2 = 3,
VERTEX_FLAG_TEXTURE3 = 4,
VERTEX_FLAG_COLOR = 5,
VERTEX_FLAG_USE_INDICES = 6
};
#define VERTEX_FLAGS_COUNT_ARR ( 5 )
#define VERTEX_FLAGS_COUNT ( 6 )

View File

@@ -39,7 +39,8 @@ class EE_API cWaypoints {
bool EraseWaypoint( const eeUint& PointNum );
/** Start the animation ( will reset the current state, and start from the beginning )
@param PathEndCallback An optional callback fired when the animation ends.
* @param PathEndCallback An optional callback fired when the animation ends.
* @param StepCallback An optional callback that is fired every time that a step is completed.
*/
void Start( OnPathEndCallback PathEndCallback = OnPathEndCallback(), OnStepCallback StepCallback = OnStepCallback() );

View File

@@ -52,6 +52,7 @@ T Line2<T>::GetAngle() {
/** Determine if two lines are intersecting
* @param line The line to intersect
* @param X Optional Pointer returning the X point position of intersection
* @param Y Optional Pointer returning the Y point position of intersection
* @return True if the lines are intersecting

View File

@@ -71,7 +71,7 @@ class Polygon2 {
tRECT<T> ToAABB();
static Polygon2<T> CreateRoundedPolygon( const T& x, const T& y, const T& width, const T& height, const eeUint& Radius = 8 );
static Polygon2<T> CreateRoundedRectangle( const T& x, const T& y, const T& width, const T& height, const eeUint& Radius = 8 );
static bool IntersectQuad2( const Quad2<T>& q0, const Quad2<T>& q1, const Vector2<T>& q0Pos = Vector2<T>(0,0), const Vector2<T>& q1Pos = Vector2<T>(0,0) );
@@ -184,7 +184,7 @@ void Polygon2<T>::Scale( const T& scale, const Vector2<T>& Center ) {
}
template<typename T>
Polygon2<T> Polygon2<T>::CreateRoundedPolygon( const T& x, const T& y, const T& width, const T& height, const eeUint& Radius ) {
Polygon2<T> Polygon2<T>::CreateRoundedRectangle( const T& x, const T& y, const T& width, const T& height, const eeUint& Radius ) {
T PI05 = EE_PI * 0.5f;
T PI15 = EE_PI * 1.5f;
T PI20 = EE_PI2;

View File

@@ -135,16 +135,25 @@ class EE_API cIniFile {
bool SetValue ( unsigned const keyID, unsigned const valueID, std::string const value );
/** Sets the value from a keyname and a valuename
* @param keyname The key name
* @param valuename The value name
* @param value The value to assign
* @param create If true it will create the keyname if doesn't exists
*/
bool SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create = true );
/** Sets a integer value from a keyname and a valuename
* @param keyname The key name
* @param valuename The value name
* @param value The value to assign
* @param create If true it will create the keyname if doesn't exists
*/
bool SetValueI ( std::string const keyname, std::string const valuename, int const value, bool create = true );
/** Sets a boolean value from a keyname and a valuename
* @param keyname The key name
* @param valuename The value name
* @param value The value to assign
* @param create If true it will create the keyname if doesn't exists
*/
bool SetValueB ( std::string const keyname, std::string const valuename, bool const value, bool create = true ) {
@@ -152,6 +161,9 @@ class EE_API cIniFile {
}
/** Sets a double value from a keyname and a valuename
* @param keyname The key name
* @param valuename The value name
* @param value The value to assign
* @param create If true it will create the keyname if doesn't exists
*/
bool SetValueF ( std::string const keyname, std::string const valuename, double const value, bool create = true );

View File

@@ -12,7 +12,7 @@ class EE_API cObjectLoader : protected cThread {
public:
typedef cb::Callback1<void, cObjectLoader *> ObjLoadCallback;
/** @enum Definition of the Object Loaders implemented by the engine. */
/** @enum cObjectLoader::ObjLoaderType Definition of the Object Loaders implemented by the engine. */
enum ObjLoaderType {
TextureLoader = 1,
SoundLoader = 2,

View File

@@ -29,7 +29,7 @@ class EE_API cPackManager : public tContainer<cPack> {
const bool& FallbackToPacks() const;
/** @brief Sets if the files that failed to be loaded from the file system should try to be loaded from the currently open packs.
** @example For example if you try to load a texture from the file system a fails it will search the same path in the opened packs, and load it from there.
** For example if you try to load a texture from the file system a fails it will search the same path in the opened packs, and load it from there.
** cTextureFactory::instance()->Load( "mytexture.png" );
** If the file is not in the file system, it will be searched in the opened packs, and loaded if is found.
** In case that the process path is appended to the path... like Sys::GetProcessPath() + "mytexture.png", the process path will be removed from the file path.

View File

@@ -113,7 +113,7 @@ class EE_API cThread {
Private::ThreadFunc * mEntryPoint; ///< Abstraction of the function to run
};
//! Taken from SFML threads
// Taken from SFML threads
namespace Private {
// Base class for abstract thread functions

View File

@@ -87,7 +87,7 @@ class EE_API FileSystem {
static bool MakeDir( const std::string& path, const Uint16& mode = 0770 );
/** Convert a size represented in bytes, to a string converted in byes/kb/mb/tb.
* @example 10485760 -> "10.0 MB"
* For example 10485760 -> "10.0 MB"
*/
static std::string SizeToString(const Int64& Size );

View File

@@ -59,7 +59,7 @@ class EE_API cCursorManager {
virtual void Remove( const std::string& name, bool Delete = false );
/** Removes the cursor by its id
* @param cursor The cursor pointer
* @param id The cursor pointer id
* @param Delete Indicates if the cursor must be delete after being removed from the cursor manager
*/
virtual void Remove( const Uint32& id, bool Delete = false );

View File

@@ -134,10 +134,10 @@ class EE_API cInput {
const Uint32& LastPressTrigger() const;
/** @return The current state as flags of the mouse press trigger
@example The usage is simple, to know if the left mouse click is pressed you need to check against the left mouse flag mask
if ( myInput->PressTrigger() & EE_BUTTON_LMASK ) ...
@brief Triggers are used mostly for the UI components. They are simple to manage.
The mouse flags are defined in keycodes.hpp
For Example The usage is simple, to know if the left mouse click is pressed you need to check against the left mouse flag mask
if ( myInput->PressTrigger() & EE_BUTTON_LMASK ) ...
*/
const Uint32& PressTrigger() const;

View File

@@ -5,7 +5,7 @@
namespace EE { namespace Window {
/** @brief The class defines a view like a 2D camera ( position, size, move, scale ). \nBasically is a 2D proyection in pixels seted over a viewport. */
/** @brief The class defines a view like a 2D camera ( position, size, move, scale ). Basically is a 2D proyection in pixels seted over a viewport. */
class EE_API cView {
public:
cView();

View File

@@ -13,7 +13,7 @@ class cInput;
class cCursorManager;
/** @namespace WindowStyle Define the Windows Styles */
/** @namespace EE::Window::WindowStyle Define the Windows Styles */
namespace WindowStyle {
enum
{
@@ -30,7 +30,7 @@ namespace WindowStyle {
};
}
/** @namespace WindowBackend Define the window backends supported by eepp */
/** @namespace EE::Window::WindowBackend Define the window backends supported by eepp */
namespace WindowBackend {
enum
{
@@ -42,7 +42,7 @@ namespace WindowBackend {
};
}
/** @class WindowSettings A small class that contains the window settings */
/** @brief WindowSettings A small class that contains the window settings */
class WindowSettings {
public:
@@ -73,7 +73,7 @@ class WindowSettings {
Uint32 Backend;
};
/** @class ContextSettings Small class that contains the renderer context information */
/** @brief ContextSettings Small class that contains the renderer context information */
class ContextSettings {
public:
@@ -100,7 +100,7 @@ class ContextSettings {
bool DoubleBuffering;
};
/** @class WindowInfo Contains the window state information */
/** @brief WindowInfo Contains the window state information */
class WindowInfo {
public:

View File

@@ -295,7 +295,7 @@ enum EE_BUTTON {
#define EE_BUTTON_MASK(X) ( 1 << ( ( X ) - 1 ) )
/** @enum EE_BUTTON_MASK Mouse buttons mask, to check the current state of every button. */
/** @enum EE_BUTTON_MASKS Mouse buttons mask, to check the current state of every button. */
enum EE_BUTTON_MASKS {
EE_BUTTON_LMASK = EE_BUTTON_MASK( EE_BUTTON_LEFT ),
EE_BUTTON_MMASK = EE_BUTTON_MASK( EE_BUTTON_MIDDLE ),

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.6.1, 2013-01-19T17:51:45. -->
<!-- Written by Qt Creator 2.6.1, 2013-01-20T01:41:43. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -48,7 +48,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">{388e5431-b31b-42b3-b9ad-9002d279d75d}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">10</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">

View File

@@ -172,7 +172,7 @@ void cPrimitives::DrawRoundedRectangle( const eeRectf& R, const eeColorA& TopLef
eeFloat xscalediff = size.Width() * Scale - size.Width();
eeFloat yscalediff = size.Height() * Scale - size.Height();
eeVector2f Center( R.Left + size.Width() * 0.5f + xscalediff, R.Top + size.Height() * 0.5f + yscalediff );
eePolygon2f Poly = eePolygon2f::CreateRoundedPolygon( R.Left - xscalediff, R.Top - yscalediff, size.Width() + xscalediff, size.Height() + yscalediff, Corners );
eePolygon2f Poly = eePolygon2f::CreateRoundedRectangle( R.Left - xscalediff, R.Top - yscalediff, size.Width() + xscalediff, size.Height() + yscalediff, Corners );
eeVector2f poly;
Poly.Rotate( Angle, Center );

View File

@@ -418,17 +418,17 @@ bool cTexture::IsCompressed() const {
return 0 != ( mFlags & TEX_FLAG_COMPRESSED );
}
void cTexture::Draw( const eeFloat &x, const eeFloat &y, const eeFloat &Angle, const eeFloat &Scale, const eeColorA& Color, const EE_BLEND_MODE &blend, const EE_RENDER_MODE &Effect, const bool &ScaleCentered, const eeRecti& texSector) {
DrawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, blend, Effect, ScaleCentered, texSector);
void cTexture::Draw( const eeFloat &x, const eeFloat &y, const eeFloat &Angle, const eeFloat &Scale, const eeColorA& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, const bool &ScaleCentered, const eeRecti& texSector) {
DrawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, Blend, Effect, ScaleCentered, texSector);
}
void cTexture::DrawFast( const eeFloat& x, const eeFloat& y, const eeFloat& Angle, const eeFloat& Scale, const eeColorA& Color, const EE_BLEND_MODE &blend, const eeFloat &width, const eeFloat &height ) {
void cTexture::DrawFast( const eeFloat& x, const eeFloat& y, const eeFloat& Angle, const eeFloat& Scale, const eeColorA& Color, const EE_BLEND_MODE &Blend, const eeFloat &width, const eeFloat &height ) {
eeFloat w = width, h = height;
if (!w) w = (eeFloat)ImgWidth();
if (!h) h = (eeFloat)ImgHeight();
sBR->SetTexture( this );
sBR->SetBlendMode( blend );
sBR->SetBlendMode( Blend );
sBR->QuadsBegin();
sBR->QuadsSetColor( Color );

View File

@@ -1,5 +1,6 @@
#include <eepp/graphics/cttffontloader.hpp>
#include <eepp/graphics/cfontmanager.hpp>
#include <eepp/graphics/ctexturefactory.hpp>
namespace EE { namespace Graphics {
@@ -114,6 +115,8 @@ cFont * cTTFFontLoader::Font() const {
void cTTFFontLoader::Unload() {
if ( mLoaded ) {
cTextureFactory::instance()->Remove( mFont->GetTexId() );
cFontManager::instance()->Remove( mFont );
Reset();

View File

@@ -116,7 +116,7 @@ void cEETest::Init() {
if ( NULL != mFBO )
mFBO->ClearColor( eeColorAf( 0, 0, 0, 0.5f ) );
eePolygon2f Poly = eePolygon2f::CreateRoundedPolygon( 0, 0, 256, 50 );
eePolygon2f Poly = eePolygon2f::CreateRoundedRectangle( 0, 0, 256, 50 );
mVBO = cVertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN );