Changes between Version 4 and Version 5 of documentation/C++Manual/Interfaces
- Timestamp:
- 09/17/10 04:43:17 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
documentation/C++Manual/Interfaces
v4 v5 21 21 {{{ 22 22 // Opens a file. 23 virtual Rocket::Core::FileHandle Open(const EMP::Core::String& path) = 0;23 virtual Rocket::Core::FileHandle Open(const Rocket::Core::String& path) = 0; 24 24 25 25 // Closes a previously opened file. 63 63 {{{ 64 64 // Translate the input string into the translated string. 65 virtual int TranslateString( EMP::Core::String& translated, const EMP::Core::String& input);65 virtual int TranslateString(Rocket::Core::String& translated, const Rocket::Core::String& input); 66 66 67 67 // Log the specified message. 68 virtual bool LogMessage( EMP::Core::Log::Type type, const EMP::Core::String& message);68 virtual bool LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String& message); 69 69 }}} 70 70 77 77 Note that the translated text can include RML tags and they will be processed as if they were in the original stream; this can be used, for example, to substitute images for certain tokens. 78 78 79 The LogMessage() function is called whenever Rocket generates a message. ''type'' is one of the logging type, '' EMP::Core::Log::ERROR'' for error messages, ''EMP::Core::Log::ASSERT'' for failed internal assertions (debug library only), ''EMP::Core::Log::WARNING'' for non-fatal warnings, or ''EMP::Core::Log::INFO'' for generic information messages. The ''message'' parameter is the actual message itself. The function should return true if program execution should continue, or false to generate an interrupt to break execution. This can be useful if you are running inside a debugger to see exactly what an application is doing to trigger a certain message.79 The LogMessage() function is called whenever Rocket generates a message. ''type'' is one of the logging type, ''Rocket::Core::Log::ERROR'' for error messages, ''Rocket::Core::Log::ASSERT'' for failed internal assertions (debug library only), ''Rocket::Core::Log::WARNING'' for non-fatal warnings, or ''Rocket::Core::Log::INFO'' for generic information messages. The ''message'' parameter is the actual message itself. The function should return true if program execution should continue, or false to generate an interrupt to break execution. This can be useful if you are running inside a debugger to see exactly what an application is doing to trigger a certain message. 80 80 81 81 == The render interface == 83 83 The render interface is how Rocket sends its generated geometry through to the application to render. It also uses the interface to load textures from external sources and from internally generated pixel data (for font textures). Applications must install a render interface before initialising Rocket. 84 84 85 The render interface is given in <EMP/Core/RenderInterface.h>. To develop a custom render interface, create a class derived from '' EMP::Core::RenderInterface'' and provide function definitions for the pure virtual functions, and any of the others that you wish to provide functionality for.85 The render interface is given in <EMP/Core/RenderInterface.h>. To develop a custom render interface, create a class derived from ''Rocket::Core::RenderInterface'' and provide function definitions for the pure virtual functions, and any of the others that you wish to provide functionality for. 86 86 87 87 === Rendering simple geometry === 91 91 {{{ 92 92 // Called by Rocket when it wants to render geometry that the application does not wish to optimise. 93 virtual void RenderGeometry(Rocket::Core::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rocket::Core::TextureHandle texture, const EMP::Core::Vector2f& translation) = 0;93 virtual void RenderGeometry(Rocket::Core::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rocket::Core::TextureHandle texture, const Rocket::Core::Vector2f& translation) = 0; 94 94 }}} 95 95 109 109 110 110 // Called by Rocket when it wants to render application-compiled geometry. 111 virtual void RenderCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry, const Core:: EMP::Vector2f& translation);111 virtual void RenderCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry, const Core::Rocket::Vector2f& translation); 112 112 113 113 // Called by Rocket when it wants to release application-compiled geometry. 148 148 // Called by Rocket when a texture is required by the library. 149 149 virtual bool LoadTexture(Rocket::Core::TextureHandle& texture_handle, 150 EMP::Core::Vector2i& texture_dimensions, 151 const EMP::Core::String& source, 152 const EMP::Core::String& source_path) = 0; 150 Rocket::Core::Vector2i& texture_dimensions, 151 const Rocket::Core::String& source) = 0; 153 152 154 153 // Called by Rocket when a texture is required to be built from an internally-generated sequence of pixels. 155 154 virtual bool GenerateTexture(Rocket::Core::TextureHandle& texture_handle, 156 const EMP::Core::byte* source,157 const EMP::Core::Vector2i& source_dimensions) = 0;155 const Rocket::Core::byte* source, 156 const Rocket::Core::Vector2i& source_dimensions) = 0; 158 157 159 158 // Called by Rocket when a loaded texture is no longer required.