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

#include <sgl.h>

Collaboration diagram for sgl::Pixmap:
Collaboration graph
[legend]

Public Member Functions

bool read_BMP_file (const char *fname)
 
bool make_checkerboard ()
 
void set_texture (unsigned int textureName)
 

Public Attributes

int nRows
 
int nCols
 
RGB * pixel
 

Detailed Description

The Pixmap class stores the number of rows and columns in the pixmap, as well as the address of the first pixel in memory. The implementation of the Pixmap class is adapted from code found in rgbpixmap.h from Hill's textbook "Computer Graphics Using OpenGL" attributed to J. J. Rajnovich, June 05, 2002

Member Function Documentation

◆ make_checkerboard()

bool sgl::Pixmap::make_checkerboard ( )

Creates a checkerboard pixmap.

Returns
true if successful and false if no memory was available for the pixmap.

◆ read_BMP_file()

bool sgl::Pixmap::read_BMP_file ( const char *  fname)

Read a BMP file into this pixmap.

Parameters
fnamethe name of the BMP file the read in.
Returns
true, if the operation was successful; otherwise, false.

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