Files
directx-plane-game/Graphics2/ColorGradient.h
iDunnoDev f6bba67897 Added follow cam
Added "Controlled" mesh classes
Added Global Lighting Class
Added Gamepad controls
Split terrain nodes into Height and Perlin classes
Fixed Splitmesh node stuff
2022-05-09 17:50:22 +01:00

36 lines
750 B
C++

#pragma once
#include <vector>
#include "SharedMethods.h"
using namespace std;
// Struct to hold the color data in
typedef struct RGBA {
unsigned int red;
unsigned int green;
unsigned int blue;
unsigned int alpha;
} RGBA;
// Class for dealing with color gradients, mainly for the terrain and blend mapping
class ColorGradient
{
public:
ColorGradient(float min, float max, vector<RGBA> colorSteps);
~ColorGradient();
// Get the RGBA value at the give point
RGBA GetRGBAValue(float inputValue);
private:
float _minValue;
float _maxValue;
// Method for interpolating the color between each step
RGBA Interpolate(RGBA a, RGBA b, float pointValue);
// Vector to hold the color steps in for the gradient
vector<RGBA> _colorSteps;
};