Simple Graphics Library  0.9.5
SGL API
Public Member Functions | List of all members
sgl::BitmapObject Class Reference

#include <sgl.h>

Inheritance diagram for sgl::BitmapObject:
Inheritance graph
[legend]
Collaboration diagram for sgl::BitmapObject:
Collaboration graph
[legend]

Public Member Functions

 BitmapObject (const char *filename, double x, double y, double width, double height)
 
void paint () const
 
- Public Member Functions inherited from sgl::GraphicalObject
 GraphicalObject (double left, double bottom, double width, double height)
 
 GraphicalObject (const GraphicalObject &other)
 
GraphicalObjectoperator= (const GraphicalObject &other)
 
virtual ~GraphicalObject ()
 
virtual double get_left () const
 
virtual double get_bottom () const
 
virtual double get_width () const
 
virtual double get_height () const
 
virtual void set (double x, double y, double width, double height)
 
virtual void move_to (double left, double bottom)
 
virtual void mouse_pressed (double x, double y, MouseButton button)
 
virtual void mouse_released (double x, double y, MouseButton button)
 
virtual void mouse_moved (double x, double y)
 
virtual void mouse_dragged (double x, double y)
 
virtual void key_pressed (int k, double x, double y)
 
virtual bool hit (double x, double y)
 
virtual Windowset_window (ObjectWindow *win)
 
virtual Windowget_window () const
 
virtual void set_mouse_over (bool flag)
 
virtual CursorShape set_cursor (CursorShape cursor)
 
virtual CursorShape get_cursor ()
 

Additional Inherited Members

- Public Attributes inherited from sgl::GraphicalObject
const unsigned id
 
- Protected Attributes inherited from sgl::GraphicalObject
ObjectWindowwindow
 
double x_hit_offset
 
double y_hit_offset
 
double left
 
double bottom
 
double width
 
double height
 
CursorShape cursor
 
bool mouse_over
 

Detailed Description

The class representing graphical objects that render bitmapped images. The image for a graphical object is loaded from a 24-bit uncompressed BMP file with dimensions that must be binary powers.

Constructor & Destructor Documentation

◆ BitmapObject()

sgl::BitmapObject::BitmapObject ( const char *  filename,
double  x,
double  y,
double  width,
double  height 
)

Constructor

Parameters
filenamethe BMP file containing the image to display.
xthe x coordinate of the bitmap image's left-bottom corner
ythe y coordinate of the bitmap image's left-bottom corner
widththe bitmap image's width
heightthe bitmap image's height

Member Function Documentation

◆ paint()

void sgl::BitmapObject::paint ( ) const
virtual

Draws the bitmap image within the window.

Implements sgl::GraphicalObject.


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