#ifndef _BITMAPCLASS_H_
#define _BITMAPCLASS_H_


//////////////
// INCLUDES //
//////////////
#include <directxmath.h>
using namespace DirectX;


///////////////////////
// MY CLASS INCLUDES //
///////////////////////
#include "texture_class.h"
#include "macro.h"


////////////////////////////////////////////////////////////////////////////////
// Class name: bitmap_class
////////////////////////////////////////////////////////////////////////////////
class bitmap_class
{
private:
    struct vertex_type
    {
        XMFLOAT3 position;
        XMFLOAT2 texture;
    };

public:
    bitmap_class();
    bitmap_class(const bitmap_class&);
    ~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);

private:
    bool initialize_buffers(ID3D11Device*);
    void shutdown_buffers();
    bool update_buffers(ID3D11DeviceContext*);
    void render_buffers(ID3D11DeviceContext*);

    bool load_texture(ID3D11Device*, ID3D11DeviceContext*, char*);
    void release_texture();
private:
    ID3D11Buffer* vertex_buffer_, * index_buffer_;
    int vertex_count_, index_count_, screen_width_, screen_height_, bitmap_width_, bitmap_height_, render_x_, render_y_, prev_pos_x_, prev_pos_y_;
    texture_class* texture_;

};

#endif