HOG2
|
#include "GLUtil.h"
#include "Graphics.h"
#include <stdio.h>
#include <cstring>
#include <cinttypes>
Go to the source code of this file.
Classes | |
struct | recRotation |
struct | recFrustum |
struct | recCamera |
struct | viewport |
struct | recContext |
class | commandLineCallbackData |
** More... | |
class | keyboardCallbackData |
class | joystickCallbackData |
class | mouseCallbackData |
class | mouseCallbackData2 |
class | windowCallbackData |
class | frameCallbackData |
Macros | |
#define | main hog_main |
Typedefs | |
typedef struct recContext | recContext |
typedef struct recContext * | pRecContext |
typedef void(* | FrameCallback) (unsigned long windowID, unsigned int viewport, void *) |
install a FrameCallback to be called once per frame and viewport This is where you should do any drawing and/or update the unit simulation time. More... | |
typedef void(* | WindowCallback) (unsigned long windowID, tWindowEventType) |
a window callback handler called when a window is created or destroyed More... | |
typedef void(* | JoystickCallback) (unsigned long windowID, double offsetX, double offsetY, void *) |
a joystaick callback handler is passed the same data passed in when it was installed More... | |
typedef bool(* | MouseCallback) (unsigned long windowID, int x, int y, point3d loc, tButtonType, tMouseEventType) |
a mouse callback handler passes the absolute and local mouse coordinates of the click returns true if the click/movement was handled; false if ignored More... | |
typedef bool(* | MouseCallback2) (unsigned long windowID, int viewport, int x, int y, point3d loc, tButtonType, tMouseEventType) |
the new callback handler also passes the viewport frame in which the click occured. More... | |
typedef void(* | KeyboardCallback) (unsigned long windowID, tKeyboardModifier, char) |
a keyboard callback handler is passed the current unit simulation, the key that was hit, and any modifiers that were being held down. More... | |
typedef int(* | CommandLineCallback) (char **, int) |
A command-line callback handler takes in a char** which points to the argument which matches the argument that this handler was installed for. More... | |
Enumerations | |
enum | viewportType { kScaleToSquare, kScaleToFill } |
enum | tKeyboardModifier { kNoModifier, kAnyModifier, kShiftDown, kControlDown, kAltDown } |
enum | tButtonType { kLeftButton, kRightButton, kMiddleButton, kNoButton } |
enum | tMouseEventType : int { kMouseDown = 0x1, kMouseUp = 0x2, kMouseDrag = 0x4, kMouseMove = 0x8 } |
enum | tWindowEventType { kWindowCreated, kWindowDestroyed } |
Functions | |
void | updateProjection (pRecContext pContextInfo, int viewPort=-1) |
Update the projection matrix based on camera and view info. More... | |
void | drawGL (pRecContext pContextInfo, bool swap) |
bool | DoKeyboardCommand (pRecContext pContextInfo, unsigned char keyHit, bool shift, bool cntrl, bool alt) |
void | initialConditions (pRecContext pContextInfo) |
void | resetCamera (recCamera *pCamera) |
void | ProcessCommandLineArgs (int argc, char *argv[]) |
void | SetNumPorts (unsigned long windowID, int count) |
int | GetNumPorts (unsigned long windowID) |
void | SetActivePort (unsigned long windowID, int which) |
int | GetActivePort (unsigned long windowID) |
void | ReinitViewports (unsigned long windowID, const Graphics::rect &r, viewportType v) |
int | AddViewport (unsigned long windowID, const Graphics::rect &r, viewportType v) |
int | AddViewport (unsigned long windowID, const Graphics::rect &initial, const Graphics::rect &fin, viewportType v) |
void | MoveViewport (unsigned long windowID, int viewport, const Graphics::rect &newLocation) |
Graphics::point | ViewportToGlobalHOG (Graphics::point where, int viewport) |
Graphics::rect | ViewportToGlobalHOG (const Graphics::rect &loc, int viewport) |
Graphics::point | ViewportToGlobalHOG (pRecContext pContextInfo, const viewport &v, Graphics::point where) |
float | ViewportToGlobalHOGX (float x, int v) |
Graphics::point | GlobalHOGToViewport (pRecContext pContextInfo, const viewport &v, Graphics::point where) |
Graphics::point | GlobalHOGToViewport (Graphics::point where, int viewport) |
Graphics::rect | GlobalHOGToViewport (const Graphics::rect &loc, int viewport) |
float | GlobalHOGToViewportX (float x, int v) |
void | InstallFrameHandler (FrameCallback jC, unsigned long windowID, void *userdata) |
void | RemoveFrameHandler (FrameCallback jC, unsigned long windowID, void *userdata) |
void | HandleFrame (pRecContext pContextInfo, int viewport) |
void | InstallJoystickHandler (JoystickCallback jC, void *userdata) |
void | RemoveJoystickHandler (JoystickCallback jC, void *userdata) |
void | HandleJoystickMovement (pRecContext pContextInfo, double panX, double panY) |
void | InstallMouseClickHandler (MouseCallback mC, tMouseEventType which=static_cast< tMouseEventType >(kMouseDown|kMouseUp|kMouseDrag)) |
void | InstallMouseClickHandler (MouseCallback2 mC, tMouseEventType which=static_cast< tMouseEventType >(kMouseDown|kMouseUp|kMouseDrag)) |
void | RemoveMouseClickHandler (MouseCallback mC) |
void | RemoveMouseClickHandler (MouseCallback2 mC) |
bool | HandleMouse (pRecContext pContextInfo, point3d where, tButtonType button, tMouseEventType mouse) |
bool | HandleMouse (pRecContext pContextInfo, int xWindow, int yWindow, point3d where, tButtonType button, tMouseEventType mouse) |
bool | HandleMouseClick (pRecContext pContextInfo, int x, int y, point3d where, tButtonType, tMouseEventType) |
bool | HandleMouseClick (pRecContext pContextInfo, int viewport, int x, int y, point3d where, tButtonType, tMouseEventType) |
void | InstallWindowHandler (WindowCallback wC) |
void | RemoveWindowHandler (WindowCallback wC) |
void | HandleWindowEvent (pRecContext pContextInfo, tWindowEventType) |
void | InstallKeyboardHandler (KeyboardCallback kf, const char *title, const char *description, tKeyboardModifier mod, unsigned char firstKey, unsigned char lastKey=0) |
void | GetKeyAssignments (std::vector< char > &keys) |
void | GetKeyAssignmentDescriptions (std::vector< std::string > &keys) |
void | PrintKeyboardAssignments () |
void | InstallCommandLineHandler (CommandLineCallback, const char *, const char *, const char *) |
void | PrintCommandLineArguments () |
void | RunHOGGUI (int argc, char *argv[], int windowDimension=1000) |
void | RunHOGGUI (int argc, char *argv[], int xDimension, int yDimension) |
void | SaveScreenshot (unsigned long windowID, const char *filename) |
void | SetZoom (int windowID, float amount) |
void | submitTextToBuffer (const char *val) |
void | appendTextToBuffer (const char *) |
const char * | getTextBuffer () |
void | setTextBufferVisibility (bool) |
bool | getTextBufferVisibility () |
pRecContext | getCurrentContext () |
pRecContext | GetContext (unsigned long windowID) |
void | updateModelView (pRecContext pContextInfo, int currPort) |
Updates the viewpoint of the model. More... | |
void | cameraLookAt (GLfloat, GLfloat, GLfloat, float cameraSpeed=0.1, int port=-1) |
recVec | cameraLookingAt (int port=-1) |
void | cameraMoveTo (GLfloat x, GLfloat y, GLfloat z, float cameraSpeed=0.1, int port=-1) |
void | cameraOffset (GLfloat x, GLfloat y, GLfloat z, float cameraSpeed=0.1, int port=-1) |
void | resetCamera () |
recVec | GetHeading (unsigned long windowID, int which) |
void | GetHeading (unsigned long windowID, int which, GLdouble &hx, GLdouble &hy, GLdouble &hz) |
void | setPortCamera (pRecContext pContextInfo, int currPort) |
void | setViewport (pRecContext pContextInfo, int currPort) |
Variables | |
const int | MAXPORTS = 6 |
GLfloat | gTrackBallRotation [4] |
pRecContext | gTrackingContextInfo |
char | gDefaultMap [1024] |
const char | kLeftArrow = 0x11 |
const char | kRightArrow = 0x12 |
const char | kUpArrow = 0x13 |
const char | kDownArrow = 0x14 |
typedef int(* CommandLineCallback) (char **, int) |
A command-line callback handler takes in a char** which points to the argument which matches the argument that this handler was installed for.
The second argument is the number of remaining arguments available. The handler can process and use as many of the remaining arguments, and returns the number of arguments it processed.
typedef void(* FrameCallback) (unsigned long windowID, unsigned int viewport, void *) |
install a FrameCallback to be called once per frame and viewport This is where you should do any drawing and/or update the unit simulation time.
The viewports will be processed in order (0..#, max 4), so any global processing should only be done when the viewport is 0. The void* data is passed back to each call.
typedef void(* JoystickCallback) (unsigned long windowID, double offsetX, double offsetY, void *) |
typedef void(* KeyboardCallback) (unsigned long windowID, tKeyboardModifier, char) |
typedef bool(* MouseCallback) (unsigned long windowID, int x, int y, point3d loc, tButtonType, tMouseEventType) |
typedef bool(* MouseCallback2) (unsigned long windowID, int viewport, int x, int y, point3d loc, tButtonType, tMouseEventType) |
typedef struct recContext* pRecContext |
typedef struct recContext recContext |
typedef void(* WindowCallback) (unsigned long windowID, tWindowEventType) |
enum tButtonType |
enum tKeyboardModifier |
enum tMouseEventType : int |
enum tWindowEventType |
enum viewportType |
int AddViewport | ( | unsigned long | windowID, |
const Graphics::rect & | initial, | ||
const Graphics::rect & | fin, | ||
viewportType | v | ||
) |
Definition at line 325 of file Common.cpp.
References viewport::active, viewport::bounds, viewport::finalBound, GetContext(), MAXPORTS, recContext::numPorts, pContextInfo, viewport::type, and recContext::viewports.
int AddViewport | ( | unsigned long | windowID, |
const Graphics::rect & | r, | ||
viewportType | v | ||
) |
Definition at line 306 of file Common.cpp.
References viewport::active, viewport::bounds, viewport::finalBound, GetContext(), MAXPORTS, recContext::numPorts, pContextInfo, viewport::type, and recContext::viewports.
void appendTextToBuffer | ( | const char * | ) |
Definition at line 691 of file GLUThog.cpp.
References bufferVisibility, recContext::message, myTextBox, pContextInfo, point3d, and TextBox::setColor().
void cameraLookAt | ( | GLfloat | , |
GLfloat | , | ||
GLfloat | , | ||
float | cameraSpeed = 0.1 , |
||
int | port = -1 |
||
) |
Definition at line 775 of file Common.cpp.
References recContext::camera, recContext::currPort, getCurrentContext(), pContextInfo, updateProjection(), recCamera::viewDir, recCamera::viewPos, recVec::x, recVec::y, and recVec::z.
recVec cameraLookingAt | ( | int | port = -1 | ) |
Definition at line 766 of file Common.cpp.
References recContext::camera, recContext::currPort, getCurrentContext(), pContextInfo, and recCamera::viewDir.
void cameraMoveTo | ( | GLfloat | x, |
GLfloat | y, | ||
GLfloat | z, | ||
float | cameraSpeed = 0.1 , |
||
int | port = -1 |
||
) |
Definition at line 792 of file Common.cpp.
References recContext::camera, recContext::currPort, getCurrentContext(), pContextInfo, updateProjection(), recCamera::viewPos, recVec::x, recVec::y, and recVec::z.
void cameraOffset | ( | GLfloat | x, |
GLfloat | y, | ||
GLfloat | z, | ||
float | cameraSpeed = 0.1 , |
||
int | port = -1 |
||
) |
Definition at line 808 of file Common.cpp.
References recContext::camera, recContext::currPort, getCurrentContext(), pContextInfo, updateProjection(), recCamera::viewPos, recVec::x, recVec::y, and recVec::z.
bool DoKeyboardCommand | ( | pRecContext | pContextInfo, |
unsigned char | keyHit, | ||
bool | shift, | ||
bool | cntrl, | ||
bool | alt | ||
) |
Definition at line 703 of file Common.cpp.
References DoKeyboardCallbacks(), kAltDown, kControlDown, kNoModifier, kShiftDown, and pContextInfo.
Referenced by keyPressed(), and RunHOGGUI().
void drawGL | ( | pRecContext | pContextInfo, |
bool | swap | ||
) |
int GetActivePort | ( | unsigned long | windowID | ) |
Definition at line 929 of file Common.cpp.
References recContext::currPort, GetContext(), and pContextInfo.
Referenced by MyDisplayHandler().
pRecContext GetContext | ( | unsigned long | windowID | ) |
Definition at line 44 of file GLUThog.cpp.
References pContextInfo.
Referenced by AddViewport(), GetActivePort(), GetHeading(), GetNumPorts(), MoveViewport(), ReinitViewports(), SaveScreenshot(), SetActivePort(), SetNumPorts(), and SetZoom().
pRecContext getCurrentContext | ( | ) |
Definition at line 49 of file GLUThog.cpp.
Referenced by cameraLookAt(), cameraLookingAt(), cameraMoveTo(), cameraOffset(), GlobalHOGToViewport(), GlobalHOGToViewportX(), GlobalHOGToViewportY(), resetCamera(), ViewportToGlobalHOG(), and ViewportToGlobalHOGX().
recVec GetHeading | ( | unsigned long | windowID, |
int | which | ||
) |
Definition at line 1036 of file Common.cpp.
References GetHeading(), recVec::x, recVec::y, and recVec::z.
Referenced by GetHeading().
void GetHeading | ( | unsigned long | windowID, |
int | which, | ||
GLdouble & | hx, | ||
GLdouble & | hy, | ||
GLdouble & | hz | ||
) |
Definition at line 1043 of file Common.cpp.
References recContext::camera, recRotation::cameraRotation, GetContext(), pContextInfo, PI, and recCamera::rotations.
void GetKeyAssignmentDescriptions | ( | std::vector< std::string > & | keys | ) |
Definition at line 97 of file Common.cpp.
References keyboardCallbacks, and keyboardCallbackData::next.
void GetKeyAssignments | ( | std::vector< char > & | keys | ) |
Definition at line 84 of file Common.cpp.
References keyboardCallbacks, and keyboardCallbackData::next.
int GetNumPorts | ( | unsigned long | windowID | ) |
Definition at line 923 of file Common.cpp.
References GetContext(), recContext::numPorts, and pContextInfo.
Referenced by MyDisplayHandler(), and MyFrameHandler().
const char* getTextBuffer | ( | ) |
bool getTextBufferVisibility | ( | ) |
Definition at line 810 of file SFML_HOG.cpp.
References bufferVisibility.
Graphics::rect GlobalHOGToViewport | ( | const Graphics::rect & | loc, |
int | viewport | ||
) |
Definition at line 393 of file Common.cpp.
References getCurrentContext(), GlobalHOGToViewport(), pContextInfo, and recContext::viewports.
Graphics::point GlobalHOGToViewport | ( | Graphics::point | where, |
int | viewport | ||
) |
Definition at line 381 of file Common.cpp.
References getCurrentContext(), GlobalHOGToViewport(), pContextInfo, and recContext::viewports.
Referenced by GlobalHOGToViewport(), and HandleMouse().
Graphics::point GlobalHOGToViewport | ( | pRecContext | pContextInfo, |
const viewport & | v, | ||
Graphics::point | where | ||
) |
Definition at line 407 of file Common.cpp.
References Graphics::rect::bottom, viewport::bounds, kScaleToFill, kScaleToSquare, Graphics::rect::left, max, pContextInfo, Graphics::rect::right, Graphics::rect::top, viewport::type, recContext::windowHeight, recContext::windowWidth, Graphics::point::x, and Graphics::point::y.
float GlobalHOGToViewportX | ( | float | x, |
int | v | ||
) |
Definition at line 347 of file Common.cpp.
References getCurrentContext(), pContextInfo, recContext::viewports, ViewportToGlobalHOG(), and Graphics::point::x.
void HandleFrame | ( | pRecContext | pContextInfo, |
int | viewport | ||
) |
Definition at line 163 of file Common.cpp.
References viewport::bounds, recContext::display, Graphics::Display::EndFrame(), viewport::finalBound, glDrawCallbacks, Graphics::rect::lerp(), recContext::numPorts, pContextInfo, recContext::viewports, and recContext::windowID.
Referenced by drawGL(), and GetOGLPos().
void HandleJoystickMovement | ( | pRecContext | pContextInfo, |
double | panX, | ||
double | panY | ||
) |
Definition at line 198 of file Common.cpp.
References joystickCallbacks, pContextInfo, and recContext::windowID.
bool HandleMouse | ( | pRecContext | pContextInfo, |
int | xWindow, | ||
int | yWindow, | ||
point3d | where, | ||
tButtonType | button, | ||
tMouseEventType | mouse | ||
) |
Definition at line 564 of file Common.cpp.
References viewport::bounds, GlobalHOGToViewport(), HandleMouseClick(), MAXPORTS, pContextInfo, Graphics::PointInRect(), and recContext::viewports.
Referenced by RunHOGGUI().
bool HandleMouse | ( | pRecContext | pContextInfo, |
point3d | where, | ||
tButtonType | button, | ||
tMouseEventType | mouse | ||
) |
Definition at line 582 of file Common.cpp.
References viewport::bounds, GlobalHOGToViewport(), HandleMouseClick(), MAXPORTS, pContextInfo, Graphics::PointInRect(), and recContext::viewports.
bool HandleMouseClick | ( | pRecContext | pContextInfo, |
int | viewport, | ||
int | x, | ||
int | y, | ||
point3d | where, | ||
tButtonType | , | ||
tMouseEventType | |||
) |
Definition at line 600 of file Common.cpp.
References HandleMouseClick(), mouseCallbacks2, pContextInfo, and recContext::windowID.
Referenced by HandleMouse(), HandleMouseClick(), if(), mouseMovedButton(), and mouseMovedNoButton().
bool HandleMouseClick | ( | pRecContext | pContextInfo, |
int | x, | ||
int | y, | ||
point3d | where, | ||
tButtonType | , | ||
tMouseEventType | |||
) |
Definition at line 619 of file Common.cpp.
References mouseCallbacks, pContextInfo, and recContext::windowID.
void HandleWindowEvent | ( | pRecContext | pContextInfo, |
tWindowEventType | |||
) |
Definition at line 652 of file Common.cpp.
References pContextInfo, windowCallbacks, and recContext::windowID.
Referenced by RunHOGGUI().
void initialConditions | ( | pRecContext | pContextInfo | ) |
Definition at line 680 of file Common.cpp.
References recContext::camera, recRotation::cameraRotation, recContext::currPort, gNextWindowID, gTrackBallRotation, kScaleToSquare, MAXPORTS, recContext::moveAllPortsTogether, recContext::numPorts, pContextInfo, ReinitViewports(), resetCamera(), recCamera::rotations, recCamera::thirdPerson, recContext::windowID, and recRotation::worldRotation.
Referenced by RunHOGGUI().
void InstallCommandLineHandler | ( | CommandLineCallback | , |
const char * | , | ||
const char * | , | ||
const char * | |||
) |
Definition at line 207 of file Common.cpp.
References commandLineCallbacks.
Referenced by InstallHandlers().
void InstallFrameHandler | ( | FrameCallback | jC, |
unsigned long | windowID, | ||
void * | userdata | ||
) |
Definition at line 143 of file Common.cpp.
References glDrawCallbacks.
Referenced by MyWindowHandler().
void InstallJoystickHandler | ( | JoystickCallback | jC, |
void * | userdata | ||
) |
Definition at line 179 of file Common.cpp.
References joystickCallbacks.
void InstallKeyboardHandler | ( | KeyboardCallback | kf, |
const char * | title, | ||
const char * | description, | ||
tKeyboardModifier | mod, | ||
unsigned char | firstKey, | ||
unsigned char | lastKey = 0 |
||
) |
Definition at line 73 of file Common.cpp.
References keyboardCallbacks.
Referenced by InstallHandlers().
void InstallMouseClickHandler | ( | MouseCallback | mC, |
tMouseEventType | which = static_cast< tMouseEventType >(kMouseDown|kMouseUp|kMouseDrag) |
||
) |
Definition at line 255 of file Common.cpp.
References mouseCallbacks.
Referenced by InstallHandlers().
void InstallMouseClickHandler | ( | MouseCallback2 | mC, |
tMouseEventType | which = static_cast< tMouseEventType >(kMouseDown|kMouseUp|kMouseDrag) |
||
) |
Definition at line 260 of file Common.cpp.
References mouseCallbacks2.
void InstallWindowHandler | ( | WindowCallback | wC | ) |
Definition at line 634 of file Common.cpp.
References windowCallbacks.
Referenced by InstallHandlers().
void MoveViewport | ( | unsigned long | windowID, |
int | viewport, | ||
const Graphics::rect & | newLocation | ||
) |
Definition at line 341 of file Common.cpp.
References viewport::finalBound, GetContext(), pContextInfo, and recContext::viewports.
void PrintCommandLineArguments | ( | ) |
Definition at line 213 of file Common.cpp.
References commandLineCallbacks.
Referenced by ProcessCommandLineArgs().
void PrintKeyboardAssignments | ( | ) |
Definition at line 109 of file Common.cpp.
References getModifierText(), keyboardCallbacks, and keyboardCallbackData::next.
Referenced by DoKeyboardCallbacks().
void ProcessCommandLineArgs | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 222 of file Common.cpp.
References commandLineCallbacks, and PrintCommandLineArguments().
Referenced by RunHOGGUI().
void ReinitViewports | ( | unsigned long | windowID, |
const Graphics::rect & | r, | ||
viewportType | v | ||
) |
Definition at line 291 of file Common.cpp.
References viewport::active, viewport::bounds, viewport::finalBound, GetContext(), MAXPORTS, recContext::numPorts, pContextInfo, viewport::type, and recContext::viewports.
Referenced by initialConditions().
void RemoveFrameHandler | ( | FrameCallback | jC, |
unsigned long | windowID, | ||
void * | userdata | ||
) |
Definition at line 148 of file Common.cpp.
References glDrawCallbacks.
Referenced by MyWindowHandler().
void RemoveJoystickHandler | ( | JoystickCallback | jC, |
void * | userdata | ||
) |
Definition at line 184 of file Common.cpp.
References joystickCallbacks.
void RemoveMouseClickHandler | ( | MouseCallback | mC | ) |
Definition at line 265 of file Common.cpp.
References mouseCallbacks.
void RemoveMouseClickHandler | ( | MouseCallback2 | mC | ) |
Definition at line 278 of file Common.cpp.
References mouseCallbacks2.
void RemoveWindowHandler | ( | WindowCallback | wC | ) |
Definition at line 639 of file Common.cpp.
References windowCallbacks.
void resetCamera | ( | ) |
Definition at line 722 of file Common.cpp.
References recContext::camera, recRotation::cameraRotation, getCurrentContext(), gTrackBallRotation, gTrackingContextInfo, MAXPORTS, recContext::numPorts, pContextInfo, resetCamera(), recCamera::rotations, updateProjection(), and recRotation::worldRotation.
Referenced by initialConditions(), and resetCamera().
void resetCamera | ( | recCamera * | pCamera | ) |
Definition at line 748 of file Common.cpp.
References recCamera::aperture, recCamera::viewDir, recCamera::viewPos, recCamera::viewUp, recVec::x, recVec::y, and recVec::z.
void RunHOGGUI | ( | int | argc, |
char * | argv[], | ||
int | windowDimension = 1000 |
||
) |
Referenced by main().
void RunHOGGUI | ( | int | argc, |
char * | argv[], | ||
int | xDimension, | ||
int | yDimension | ||
) |
Definition at line 59 of file GLUThog.cpp.
References buildGL(), createMenus(), DoKeyboardCommand(), drawGL(), HandleMouse(), HandleWindowEvent(), initialConditions(), kDownArrow, keyPressed(), kLeftArrow, kLeftButton, kMiddleButton, kMouseDown, kMouseDrag, kMouseMove, kMouseUp, kNoButton, kRightArrow, kRightButton, kUpArrow, kWindowCreated, mouseMovedButton(), mouseMovedNoButton(), mousePressedButton(), pContextInfo, ProcessCommandLineArgs(), renderScene(), resizeGL(), resizeWindow(), recContext::windowHeight, WindowToHOG(), and recContext::windowWidth.
void SaveScreenshot | ( | unsigned long | windowID, |
const char * | filename | ||
) |
Definition at line 970 of file Common.cpp.
References bmp_header::bfSize, bmp_header::biHeight, bmp_header::biSizeImage, bmp_header::biWidth, GetContext(), recContext::globalCamera, height, pContextInfo, recCamera::viewHeight, recCamera::viewWidth, and width.
Referenced by MyFrameHandler().
void SetActivePort | ( | unsigned long | windowID, |
int | which | ||
) |
Definition at line 935 of file Common.cpp.
References recContext::currPort, GetContext(), and pContextInfo.
Referenced by MyDisplayHandler().
void SetNumPorts | ( | unsigned long | windowID, |
int | count | ||
) |
Definition at line 903 of file Common.cpp.
References recContext::currPort, recContext::display, GetContext(), MAXPORTS, recContext::numPorts, pContextInfo, Graphics::Display::SetNumViewports(), setPortCamera(), Graphics::Display::SetViewport(), and updateProjection().
Referenced by MyDisplayHandler(), and MyWindowHandler().
void setPortCamera | ( | pRecContext | pContextInfo, |
int | currPort | ||
) |
Definition at line 823 of file Common.cpp.
References recContext::camera, recContext::globalCamera, pContextInfo, recCamera::viewHeight, recCamera::viewOriginX, recCamera::viewOriginY, and recCamera::viewWidth.
Referenced by resizeGL(), and SetNumPorts().
void setTextBufferVisibility | ( | bool | ) |
Definition at line 791 of file SFML_HOG.cpp.
References bufferVisibility, recContext::message, myTextBox, pContextInfo, and TextBox::setColor().
void setViewport | ( | pRecContext | pContextInfo, |
int | currPort | ||
) |
Definition at line 846 of file Common.cpp.
References recContext::display, recContext::globalCamera, pContextInfo, Graphics::Display::SetViewport(), recCamera::viewHeight, and recCamera::viewWidth.
Referenced by drawGL(), and GetOGLPos().
void SetZoom | ( | int | windowID, |
float | amount | ||
) |
Definition at line 1012 of file Common.cpp.
References recCamera::aperture, recContext::camera, recContext::currPort, GetContext(), recContext::moveAllPortsTogether, recContext::numPorts, pContextInfo, and updateProjection().
void submitTextToBuffer | ( | const char * | val | ) |
Definition at line 704 of file GLUThog.cpp.
References bufferVisibility, recContext::message, myTextBox, pContextInfo, point3d, and TextBox::setColor().
void updateModelView | ( | pRecContext | pContextInfo, |
int | currPort | ||
) |
Updates the viewpoint of the model.
Definition at line 598 of file GLUThog.cpp.
References recContext::camera, recRotation::cameraRotation, recContext::currPort, gTrackBallRotation, gTrackingContextInfo, recContext::moveAllPortsTogether, MyGluLookAt(), pContextInfo, recCamera::rotations, recCamera::thirdPerson, recCamera::viewDir, recCamera::viewPos, recCamera::viewUp, recRotation::worldRotation, recVec::x, recVec::y, and recVec::z.
Referenced by drawGL(), and GetOGLPos().
void updateProjection | ( | pRecContext | pContextInfo, |
int | viewPort | ||
) |
Update the projection matrix based on camera and view info.
Should be called when viewport size, eye z position, or camera aperture changes. Also call if far or near changes which is determined by shape size in this case.
Definition at line 560 of file GLUThog.cpp.
References recCamera::aperture, recFrustum::bottom, Graphics::rect::bottom, recContext::camera, recFrustum::far, recCamera::frust, if(), recFrustum::left, Graphics::rect::left, recFrustum::near, recContext::numPorts, pContextInfo, recFrustum::right, Graphics::rect::right, screenRect, recFrustum::top, Graphics::rect::top, recCamera::viewHeight, ViewportToGlobalHOG(), recCamera::viewPos, recCamera::viewWidth, recContext::windowHeight, recContext::windowWidth, and recVec::z.
Referenced by cameraLookAt(), cameraMoveTo(), cameraOffset(), drawGL(), mouseDolly(), mouseMovedButton(), resetCamera(), resizeGL(), SetNumPorts(), and SetZoom().
Graphics::rect ViewportToGlobalHOG | ( | const Graphics::rect & | loc, |
int | viewport | ||
) |
Definition at line 400 of file Common.cpp.
References getCurrentContext(), pContextInfo, recContext::viewports, and ViewportToGlobalHOG().
Graphics::point ViewportToGlobalHOG | ( | Graphics::point | where, |
int | viewport | ||
) |
Definition at line 387 of file Common.cpp.
References getCurrentContext(), pContextInfo, recContext::viewports, and ViewportToGlobalHOG().
Referenced by GlobalHOGToViewportX(), GlobalHOGToViewportY(), updateProjection(), ViewportToGlobalHOG(), ViewportToGlobalHOGX(), and ViewportToScreen().
Graphics::point ViewportToGlobalHOG | ( | pRecContext | pContextInfo, |
const viewport & | v, | ||
Graphics::point | where | ||
) |
Definition at line 489 of file Common.cpp.
References Graphics::rect::bottom, viewport::bounds, kScaleToFill, kScaleToSquare, Graphics::rect::left, max, pContextInfo, Graphics::rect::right, Graphics::rect::top, viewport::type, recContext::windowHeight, recContext::windowWidth, Graphics::point::x, and Graphics::point::y.
float ViewportToGlobalHOGX | ( | float | x, |
int | v | ||
) |
Definition at line 358 of file Common.cpp.
References getCurrentContext(), pContextInfo, recContext::viewports, ViewportToGlobalHOG(), and Graphics::point::x.
Referenced by ViewportToScreenX().
char gDefaultMap[1024] |
Definition at line 29 of file Common.cpp.
Referenced by CreateSimulation(), MyCLHandler(), and MyFrameHandler().
GLfloat gTrackBallRotation[4] |
Definition at line 33 of file GLUThog.cpp.
Referenced by if(), initialConditions(), mouseMovedButton(), resetCamera(), and updateModelView().
pRecContext gTrackingContextInfo |
Definition at line 37 of file GLUThog.cpp.
Referenced by if(), mouseMovedNoButton(), resetCamera(), and updateModelView().
const char kDownArrow = 0x14 |
Definition at line 134 of file Common.h.
Referenced by RunHOGGUI().
const char kLeftArrow = 0x11 |
Definition at line 131 of file Common.h.
Referenced by RunHOGGUI().
const char kRightArrow = 0x12 |
Definition at line 132 of file Common.h.
Referenced by RunHOGGUI().
const char kUpArrow = 0x13 |
Definition at line 133 of file Common.h.
Referenced by RunHOGGUI().
const int MAXPORTS = 6 |
Definition at line 23 of file Common.h.
Referenced by AddViewport(), HandleMouse(), initialConditions(), MyDisplayHandler(), ReinitViewports(), resetCamera(), and SetNumPorts().