53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#ifndef __FISHBOWL_DRAW_H__
|
|
#define __FISHBOWL_DRAW_H__
|
|
|
|
#include <fishbone/pre.h>
|
|
|
|
namespace fishbone {
|
|
class Texture;
|
|
class Mesh;
|
|
class Renderer;
|
|
}; // namespace fishbone
|
|
|
|
#include <fishbone/window.h>
|
|
#include <fishbone/meshldr.h>
|
|
|
|
namespace fishbone {
|
|
class Texture {
|
|
struct Impl;
|
|
Impl* impl;
|
|
|
|
public:
|
|
Texture(fishbone::Renderer* renderer, unsigned char* rgba, int width, int height);
|
|
~Texture();
|
|
};
|
|
|
|
class Mesh {
|
|
void init(fishbone::Renderer* renderer, std::vector<struct fishbone::Vector3> vertices, std::vector<struct fishbone::Vector2> texcoords, std::vector<struct fishbone::Vector3> normals);
|
|
|
|
struct Impl;
|
|
Impl* impl;
|
|
|
|
public:
|
|
Mesh(fishbone::Renderer* renderer, std::vector<struct fishbone::Vector3> vertices, std::vector<struct fishbone::Vector2> texcoords, std::vector<struct fishbone::Vector3> normals) {
|
|
this->init(renderer, vertices, texcoords, normals);
|
|
}
|
|
Mesh(fishbone::Renderer* renderer, fishbone::MeshData* data) {
|
|
this->init(renderer, data->vertices, data->texcoords, data->normals);
|
|
}
|
|
~Mesh();
|
|
|
|
void draw();
|
|
};
|
|
|
|
class Renderer {
|
|
struct Impl;
|
|
Impl* impl;
|
|
|
|
public:
|
|
Renderer(fishbone::Window* window);
|
|
~Renderer();
|
|
};
|
|
}; // namespace fishbone
|
|
|
|
#endif
|