ScummVM API documentation
Grim::GfxTinyGL Class Reference
Inheritance diagram for Grim::GfxTinyGL:
Grim::GfxBase

Public Member Functions

void setupScreen (int screenW, int screenH) override
 
const char * getVideoDeviceName () override
 
void setupCameraFrustum (float fov, float nclip, float fclip) override
 
void positionCamera (const Math::Vector3d &pos, const Math::Vector3d &interest, float roll) override
 
void positionCamera (const Math::Vector3d &pos, const Math::Matrix4 &rot) override
 
Math::Matrix4 getModelView () override
 
Math::Matrix4 getProjection () override
 
void clearScreen () override
 
void clearDepthBuffer () override
 
void flipBuffer (bool opportunistic=false) override
 
bool isHardwareAccelerated () override
 
bool supportsShaders () override
 
void getScreenBoundingBox (const Mesh *model, int *x1, int *y1, int *x2, int *y2) override
 
void getScreenBoundingBox (const EMIModel *model, int *x1, int *y1, int *x2, int *y2) override
 
void getActorScreenBBox (const Actor *actor, Common::Point &p1, Common::Point &p2) override
 
void startActorDraw (const Actor *actor) override
 
void finishActorDraw () override
 
void setShadow (Shadow *shadow) override
 
void drawShadowPlanes () override
 
void setShadowMode () override
 
void clearShadowMode () override
 
void setShadowColor (byte r, byte g, byte b) override
 
void getShadowColor (byte *r, byte *g, byte *b) override
 
void set3DMode () override
 
void translateViewpointStart () override
 
void translateViewpoint (const Math::Vector3d &vec) override
 
void rotateViewpoint (const Math::Angle &angle, const Math::Vector3d &axis) override
 
void rotateViewpoint (const Math::Matrix4 &matrix) override
 
void translateViewpointFinish () override
 
void drawEMIModelFace (const EMIModel *model, const EMIMeshFace *face) override
 
void drawModelFace (const Mesh *mesh, const MeshFace *face) override
 
void drawSprite (const Sprite *sprite) override
 
void enableLights () override
 
void disableLights () override
 
void setupLight (Light *light, int lightId) override
 
void turnOffLight (int lightId) override
 
void createTexture (Texture *texture, const uint8 *data, const CMap *cmap, bool clamp) override
 
void selectTexture (const Texture *texture) override
 
void destroyTexture (Texture *texture) override
 
void createBitmap (BitmapData *bitmap) override
 
void drawBitmap (const Bitmap *bitmap, int x, int y, uint32 layer) override
 
void destroyBitmap (BitmapData *bitmap) override
 
void createFont (Font *font) override
 
void destroyFont (Font *font) override
 
void drawTextObject (const TextObject *text) override
 
void createTextObject (TextObject *text) override
 
void destroyTextObject (TextObject *text) override
 
void dimScreen () override
 
void dimRegion (int x, int y, int w, int h, float level) override
 
void irisAroundRegion (int x1, int y1, int x2, int y2) override
 
BitmapgetScreenshot (int w, int h, bool useStored) override
 
void storeDisplay () override
 
void copyStoredToDisplay () override
 
void drawEmergString (int x, int y, const char *text, const Color &fgColor) override
 
void loadEmergFont () override
 
void drawRectangle (const PrimitiveObject *primitive) override
 
void drawLine (const PrimitiveObject *primitive) override
 
void drawPolygon (const PrimitiveObject *primitive) override
 
void drawDimPlane () override
 
const Graphics::PixelFormat getMovieFormat () const override
 
void prepareMovieFrame (Graphics::Surface *frame) override
 
void drawMovieFrame (int offsetX, int offsetY) override
 
void releaseMovieFrame () override
 
void setBlendMode (bool additive) override
 
- Public Member Functions inherited from Grim::GfxBase
virtual uint getScreenWidth ()
 
virtual uint getScreenHeight ()
 
virtual bool isShadowModeActive ()
 
virtual void destroyShadow (Shadow *shadow)
 
virtual void drawMesh (const Mesh *mesh)
 
virtual void drawOverlay (const Overlay *overlay)
 
virtual void setDimLevel (float dimLevel)
 
virtual void prepareMovieFrame (Graphics::Surface *frame, const byte *palette)
 
virtual void saveState (SaveGame *state)
 
virtual void restoreState (SaveGame *state)
 
virtual void renderBitmaps (bool render)
 
virtual void renderZBitmaps (bool render)
 
virtual void makeScreenTextures ()
 
virtual void createMesh (Mesh *mesh)
 
virtual void destroyMesh (const Mesh *mesh)
 
virtual void createEMIModel (EMIModel *model)
 
virtual void updateEMIModel (const EMIModel *model)
 
virtual void destroyEMIModel (EMIModel *model)
 
virtual void createSpecialtyTexture (uint id, const uint8 *data, int width, int height)
 
TexturegetSpecialtyTexturePtr (uint id)
 
TexturegetSpecialtyTexturePtr (Common::String name)
 

Protected Member Functions

void createSpecialtyTextureFromScreen (uint id, uint8 *data, int x, int y, int width, int height) override
 
- Protected Member Functions inherited from Grim::GfxBase
BitmapcreateScreenshotBitmap (Graphics::Surface *src, int w, int h, bool flipOrientation)
 

Additional Inherited Members

- Static Public Member Functions inherited from Grim::GfxBase
static Math::Matrix4 makeLookMatrix (const Math::Vector3d &pos, const Math::Vector3d &interest, const Math::Vector3d &up)
 
static Math::Matrix4 makeProjMatrix (float fov, float nclip, float fclip)
 
- Public Attributes inherited from Grim::GfxBase
Graphics::RendererType type
 
- Protected Attributes inherited from Grim::GfxBase
Texture _specialtyTextures [_numSpecialtyTextures]
 
float _scaleW
 
float _scaleH
 
float _globalScaleW = 1.0f
 
float _globalScaleH = 1.0f
 
int _screenWidth
 
int _screenHeight
 
Shadow_currentShadowArray
 
unsigned char _shadowColorR
 
unsigned char _shadowColorG
 
unsigned char _shadowColorB
 
bool _renderBitmaps
 
bool _renderZBitmaps
 
bool _shadowModeActive
 
Math::Vector3d _currentPos
 
Math::Matrix4 _currentRot
 
float _dimLevel
 
- Static Protected Attributes inherited from Grim::GfxBase
static const unsigned int _numSpecialtyTextures = 22
 
static const int _gameHeight = 480
 
static const int _gameWidth = 640
 
static const int _globalHeight = 1080
 
static const int _globalWidth = 1920
 

Member Function Documentation

◆ setupScreen()

void Grim::GfxTinyGL::setupScreen ( int  screenW,
int  screenH 
)
overridevirtual

Creates a render-context.

Parameters
screenWthe width of the context
screenHthe height of the context

Implements Grim::GfxBase.

◆ flipBuffer()

void Grim::GfxTinyGL::flipBuffer ( bool  opportunistic = false)
overridevirtual

Swap the buffers, making the drawn screen visible

Parameters
opportunisticTrue when the flip can be avoided to spare CPU

Implements Grim::GfxBase.

◆ isHardwareAccelerated()

bool Grim::GfxTinyGL::isHardwareAccelerated ( )
overridevirtual

Query whether the current context is hardware-accelerated

Returns
true if hw-accelerated, false otherwise

Implements Grim::GfxBase.

◆ supportsShaders()

bool Grim::GfxTinyGL::supportsShaders ( )
overridevirtual

Query whether the current context supports shaders

Returns
true if supports shaders, false otherwise

Implements Grim::GfxBase.

◆ getScreenBoundingBox()

void Grim::GfxTinyGL::getScreenBoundingBox ( const Mesh mesh,
int *  x1,
int *  y1,
int *  x2,
int *  y2 
)
overridevirtual

FIXME: The implementations of these functions (for Grim and EMI, respectively) are very similar. Needs refactoring. See issue #789.

Implements Grim::GfxBase.

◆ createBitmap()

void Grim::GfxTinyGL::createBitmap ( BitmapData bitmap)
overridevirtual

Prepares a bitmap for drawing performs any format conversions needed for the renderer, and might create an internal representation of the bitmap external changes to the bitmap may not be visible after this is called. Must be called before drawBitmap can be used.

the external bitmap might have its data changed by this function,

Parameters
bitmapthe bitmap to be prepared
See also
destroyBitmap
drawBitmap

Implements Grim::GfxBase.

◆ drawBitmap()

void Grim::GfxTinyGL::drawBitmap ( const Bitmap bitmap,
int  x,
int  y,
uint32  layer 
)
overridevirtual

Draws a bitmap before this is safe to use, createBitmap MUST have been called

Parameters
bitmapthe bitmap to be drawn
See also
createBitmap
destroyBitmap

Implements Grim::GfxBase.

◆ destroyBitmap()

void Grim::GfxTinyGL::destroyBitmap ( BitmapData bitmap)
overridevirtual

Deletes any internal references and representations of a bitmap after this is called, it is safe to dispose of or change the external bitmapdata.

Parameters
bitmapthe bitmap to be destroyed
See also
createBitmap
drawBitmap

Implements Grim::GfxBase.

◆ dimScreen()

void Grim::GfxTinyGL::dimScreen ( )
overridevirtual

Dims the entire screen Sets the entire screen to 10% of its current brightness, and converts it to grayscale.

Implements Grim::GfxBase.

◆ irisAroundRegion()

void Grim::GfxTinyGL::irisAroundRegion ( int  x1,
int  y1,
int  x2,
int  y2 
)
overridevirtual

Draw a completely opaque Iris around the specified rectangle. the arguments specify the distance from the screen-edge to the first non-iris pixel.

Parameters
xthe width of the Iris
ythe height of the Iris

Implements Grim::GfxBase.

◆ prepareMovieFrame()

void Grim::GfxTinyGL::prepareMovieFrame ( Graphics::Surface frame)
overridevirtual

Prepare a movie-frame for drawing performing any necessary conversion

Parameters
widththe width of the movie-frame.
heightthe height of the movie-frame.
bitmapa pointer to the data for the movie-frame.
See also
drawMovieFrame
releaseMovieFrame

Implements Grim::GfxBase.

◆ releaseMovieFrame()

void Grim::GfxTinyGL::releaseMovieFrame ( )
overridevirtual

Release the currently prepared movie-frame, if one exists.

See also
drawMovieFrame
prepareMovieFrame

Implements Grim::GfxBase.


The documentation for this class was generated from the following file: