Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphicsframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oliver Behnke
graphicsframework
Commits
fc51ac46
Commit
fc51ac46
authored
17 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
More doxygenized code
parent
e789eba7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
AbstractGraphicsEngine.h
+87
-2
87 additions, 2 deletions
AbstractGraphicsEngine.h
ResourceFactory.h
+2
-2
2 additions, 2 deletions
ResourceFactory.h
with
89 additions
and
4 deletions
AbstractGraphicsEngine.h
+
87
−
2
View file @
fc51ac46
...
@@ -4,26 +4,109 @@
...
@@ -4,26 +4,109 @@
#include
"BOINCClientAdapter.h"
#include
"BOINCClientAdapter.h"
#include
"Resource.h"
#include
"Resource.h"
/**
* \brief This abstract class provides common features for all graphics engines
*
* All graphics engines (Open GL visualisation code) have to be derived from this class.
* First of all it defines the common interface which the rest of the graphics framework
* expects any implementing classes to support. Apart from that, this class also defines
* common properties like event idetifiers and basic access to BOINC client information.
*
* \author Oliver Bock\n
* Max-Planck-Institute for Gravitational Physics\n
* Hannover, Germany
*/
class
AbstractGraphicsEngine
class
AbstractGraphicsEngine
{
{
public:
public:
/// Default destructor
virtual
~
AbstractGraphicsEngine
();
virtual
~
AbstractGraphicsEngine
();
/**
* \brief This method is called when an implementing graphics engine should initialize itself
*
* \param width The current width of the display surface
* \param height The current height of the display surface
* \param font A pointer to a Resource object containing TTF font faces for text rendering
*/
virtual
void
initialize
(
const
int
width
,
const
int
height
,
const
Resource
*
font
)
=
0
;
virtual
void
initialize
(
const
int
width
,
const
int
height
,
const
Resource
*
font
)
=
0
;
/**
* \brief This method is called when the windowing system encounters a window resize event
*
* \param width The new width of the display surface
* \param height The new height of the display surface
*/
virtual
void
resize
(
const
int
width
,
const
int
height
)
=
0
;
virtual
void
resize
(
const
int
width
,
const
int
height
)
=
0
;
/**
* \brief This method is called when an implementing graphics engine should render one frame
*
* \param timeOfDay The current time in "seconds since the Epoch" (with microsecond precision)
*/
virtual
void
render
(
const
double
timeOfDay
)
=
0
;
virtual
void
render
(
const
double
timeOfDay
)
=
0
;
/**
* \brief This method is called when the windowing system encounters a mouse button event
*
* \param positionX The mouse position on the x-axis when the event occurred (range: 0-width)
* \param positionY The mouse position on the y-axis when the event occurred (range: 0-height)
* \param buttonPressed The mouse button pressed (if any) when the event occurred.
* It can be identified using the elements of \ref MouseButton.
*
* \see MouseButton
*/
virtual
void
mouseButtonEvent
(
const
int
positionX
,
const
int
positionY
,
const
int
buttonPressed
)
=
0
;
virtual
void
mouseButtonEvent
(
const
int
positionX
,
const
int
positionY
,
const
int
buttonPressed
)
=
0
;
/**
* \brief This method is called when the windowing system encounters a mouse move event
*
* \param deltaX The relative mouse position change with respect to the x-axis when the event occurred
* \param deltaY The relative mouse position change with respect to the y-axis when the event occurred
* \param buttonPressed The mouse button pressed (if any) when the event occurred.
* It can be identified using the elements of \ref MouseButton.
*
* \see MouseButton
*/
virtual
void
mouseMoveEvent
(
const
int
deltaX
,
const
int
deltaY
,
const
int
buttonPressed
)
=
0
;
virtual
void
mouseMoveEvent
(
const
int
deltaX
,
const
int
deltaY
,
const
int
buttonPressed
)
=
0
;
/**
* \brief This method is called when the windowing system encounters a key press event
*
* \attention Please note that not all key events are currently forwarded (this should be change
* as soon as the need arises). Please see WindowManager::eventLoop for details.
*
* \param keyPressed The keyboard key pressed. It can be identified using the elements of \ref KeyBoardKey.
*
* \see KeyBoardKey
* \see WindowManager::eventLoop
*/
virtual
void
keyboardPressEvent
(
const
int
keyPressed
)
=
0
;
virtual
void
keyboardPressEvent
(
const
int
keyPressed
)
=
0
;
/**
* \brief This method is called when the BOINC client information should be updated
*
* When you inherit from this class and override this method, please make sure you call this (base)
* method anyway as it already has a default implementation which refreshes \ref m_BoincAdapter.
*/
virtual
void
refreshBOINCInformation
();
virtual
void
refreshBOINCInformation
();
/**
* \brief Defined mouse button identifiers
*
* \see mouseButtonEvent
* \see mouseMoveEvent
*/
enum
MouseButton
{
enum
MouseButton
{
MouseButtonLeft
=
1
,
MouseButtonLeft
=
1
,
MouseButtonRight
=
2
MouseButtonRight
=
2
};
};
/**
* \brief Defined keyboard identifiers
*
* \see keyboardPressEvent
*/
enum
KeyBoardKey
{
enum
KeyBoardKey
{
KeyA
=
0x1
,
KeyA
=
0x1
,
KeyB
=
0x2
,
KeyB
=
0x2
,
...
@@ -56,9 +139,11 @@ public:
...
@@ -56,9 +139,11 @@ public:
};
};
protected
:
protected
:
/// Default constructor (protected since this is an abstract class)
AbstractGraphicsEngine
();
AbstractGraphicsEngine
();
BOINCClientAdapter
boincAdapter
;
/// BOINC client adapter instance for information retrieval
BOINCClientAdapter
m_BoincAdapter
;
};
};
#endif
/*ABSTRACTGRAPHICSENGINE_H_*/
#endif
/*ABSTRACTGRAPHICSENGINE_H_*/
This diff is collapsed.
Click to expand it.
ResourceFactory.h
+
2
−
2
View file @
fc51ac46
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment