TRX/lib/ati3dcif/TransDelay.hpp

35 lines
783 B
C++
Raw Normal View History

2021-11-12 20:03:04 +01:00
#pragma once
2021-11-14 23:44:55 +01:00
#include <ati3dcif/ATI3DCIF.h>
2021-11-12 20:03:04 +01:00
#include "Texture.hpp"
#include <functional>
2021-11-14 23:59:19 +01:00
#include <memory>
2021-11-12 20:03:04 +01:00
namespace glrage {
namespace cif {
// Delays the drawing of primitives that exhibit translucency,
// so as to render them over the top of non-translucent primitives.
class TransDelay
{
public:
void setTexture(std::shared_ptr<Texture> texture);
void setTexturingEnabled(bool enabled);
2021-11-14 23:59:19 +01:00
bool delayTriangle(C3D_VTCF* verts);
2021-11-12 20:03:04 +01:00
void render(const std::function<void(std::vector<C3D_VTCF>)>& renderer);
private:
struct TexGroup
{
std::shared_ptr<Texture> texture;
std::vector<C3D_VTCF> vtcBuffer;
};
std::vector<std::shared_ptr<TexGroup>> m_store;
2021-11-15 19:06:58 +01:00
bool m_texturing_enabled = false;
2021-11-12 20:03:04 +01:00
};
} // namespace cif
} // namespace glrage