water.h
来自「小型的3D游戏引擎」· C头文件 代码 · 共 40 行
H
40 行
#ifndef _WATER_H_
#define _WATER_H_
#include "../texture.h"
#include "../rendernode.h"
class GcWater : public GcRenderNode
{
public:
GcWater(): m_r(0.5f), m_g(0.5f), m_b(1.0f), m_a(0.7f) {}
// Initialize the water
bool Init(char *textureName, float size, float height);
// Render the water
void Render();
/* Accessors */
void SetWaterHeight(float height) { m_height = height; }
float GetWaterHeight() { return m_height; }
void SetSize(float size) { m_size = size; }
float GetSize() { return m_size; }
float SetColor(float r, float g, float b, float a) { m_r = r; m_b = b; m_g = g; m_a = a; }
private:
GcTexture m_texture;
float m_height;
float m_size;
float m_r,m_g,m_b, m_a;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?