# Khaotic Engine Reborn: bitmap_class Class Reference

Loading...
Searching...
No Matches
bitmap_class Class Reference

## Public Member Functions

| bitmap_class (const bitmap_class &)
bool | initialize (ID3D11Device *, ID3D11DeviceContext *, int, int, char *, int, int)
void | shutdown ()
bool | render (ID3D11DeviceContext *)
int | get_index_count ()
ID3D11ShaderResourceView * | get_texture ()
void | set_render_location (int, int)

## Detailed Description

Definition at line 21 of file bitmap_class.h.

## Constructor & Destructor Documentation

## bitmap_class() [1/2]

bitmap_class::bitmap_class | ( |  | ) |

Definition at line 3 of file bitmap_class.cpp.

{
vertex_buffer_ = 0;
index_buffer_ = 0;
texture_ = 0;
}

## bitmap_class() [2/2]

bitmap_class::bitmap_class | ( | const bitmap_class & | other | ) |

Definition at line 11 of file bitmap_class.cpp.

{
}

## ~bitmap_class()

bitmap_class::~bitmap_class | ( |  | ) |

Definition at line 16 of file bitmap_class.cpp.

{
}

## Member Function Documentation

## get_index_count()

int bitmap_class::get_index_count | ( |  | ) |

Definition at line 86 of file bitmap_class.cpp.

{
return index_count_;
}

## get_texture()

ID3D11ShaderResourceView * bitmap_class::get_texture | ( |  | ) |

Definition at line 91 of file bitmap_class.cpp.

{
return texture_->GetTexture();
}

## initialize()

bool bitmap_class::initialize | ( | ID3D11Device * | device,
|  | ID3D11DeviceContext * | deviceContext,
|  | int | screenWidth,
|  | int | screenHeight,
|  | char * | textureFilename,
|  | int | renderX,
|  | int | renderY )

Definition at line 21 of file bitmap_class.cpp.

{
Logger::Get().Log("Initializing bitmap class", __FILE__, __LINE__, Logger::LogLevel::Initialize);
bool result;
// Store the screen size.
screen_width_ = screenWidth;
screen_height_ = screenHeight;
// Store where the bitmap should be rendered to.
render_x_ = renderX;
render_y_ = renderY;
// initialize the vertex and index buffer that hold the geometry for the bitmap quad.
result = initialize_buffers(device);
if (!result)
{
Logger::Get().Log("Failed to initialize buffers", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Load the texture for this bitmap.
result = load_texture(device, deviceContext, textureFilename);
if (!result)
{
Logger::Get().Log("Failed to load texture", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
Logger::Get().Log("Bitmap class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
return true;
}

## render()

bool bitmap_class::render | ( | ID3D11DeviceContext * | deviceContext | ) |

Definition at line 67 of file bitmap_class.cpp.

{
bool result;
// Update the buffers if the position of the bitmap has changed from its original position.
result = update_buffers(deviceContext);
if (!result)
{
Logger::Get().Log("Failed to update buffers", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
// Put the vertex and index buffers on the graphics pipeline to prepare them for drawing.
render_buffers(deviceContext);
return true;
}

## set_render_location()

void bitmap_class::set_render_location | ( | int | x,
|  | int | y )

Definition at line 356 of file bitmap_class.cpp.

{
render_x_ = x;
render_y_ = y;
return;
}

## shutdown()

void bitmap_class::shutdown | ( |  | ) |

Definition at line 56 of file bitmap_class.cpp.

{
// Release the bitmap texture.
release_texture();
// Release the vertex and index buffers.
shutdown_buffers();
return;
}

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

- enginecustom/src/inc/system/bitmap_class.h
- enginecustom/src/src/system/bitmap_class.cpp