mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 10:59:00 +00:00
Update raylib
This commit is contained in:
@@ -36,7 +36,11 @@ namespace raylib {
|
||||
a = alpha;
|
||||
};
|
||||
Color(::Vector3 hsv) {
|
||||
set(::ColorFromHSV(hsv));
|
||||
set(::ColorFromHSV(hsv.x, hsv.y, hsv.z));
|
||||
};
|
||||
static Color FromHSV(float hue, float saturation, float value) {
|
||||
::Color color = ::ColorFromHSV(hue, saturation, value);
|
||||
return color;
|
||||
};
|
||||
Color(int hexValue) {
|
||||
set(::GetColor(hexValue));
|
||||
|
||||
@@ -17,19 +17,23 @@ namespace raylib {
|
||||
class Font : public ::Font {
|
||||
public:
|
||||
Font() {
|
||||
set(GetFontDefault());
|
||||
set(::GetFontDefault());
|
||||
}
|
||||
|
||||
Font(const std::string& fileName) {
|
||||
set(LoadFont(fileName.c_str()));
|
||||
set(::LoadFont(fileName.c_str()));
|
||||
}
|
||||
|
||||
Font(const std::string& fileName, int fontSize, int* fontChars, int charCount) {
|
||||
set(LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount));
|
||||
set(::LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount));
|
||||
}
|
||||
|
||||
Font(::Image& image, ::Color key, int firstChar) {
|
||||
set(LoadFontFromImage(image, key, firstChar));
|
||||
set(::LoadFontFromImage(image, key, firstChar));
|
||||
}
|
||||
|
||||
Font(const std::string& fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount) {
|
||||
set(::LoadFontFromMemory(fileType.c_str(), fileData, dataSize, fontSize, fontChars, charsCount));
|
||||
}
|
||||
|
||||
~Font() {
|
||||
|
||||
@@ -168,6 +168,11 @@ namespace raylib {
|
||||
::ImageCrop(this, crop);
|
||||
return *this;
|
||||
}
|
||||
inline Image& Crop(int offsetX, int offsetY, int newWidth, int newHeight) {
|
||||
::ImageCrop(this, (Rectangle){ (float)offsetX, (float)offsetY, (float)newWidth, (float)newHeight });
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& Resize(int newWidth, int newHeight) {
|
||||
::ImageResize(this, newWidth, newHeight);
|
||||
return *this;
|
||||
@@ -176,14 +181,17 @@ namespace raylib {
|
||||
::ImageResizeNN(this, newWidth, newHeight);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& ResizeCanvas(int newWidth, int newHeight, int offsetX, int offsetY, Color color) {
|
||||
::ImageResizeCanvas(this, newWidth, newHeight, offsetX, offsetY, color);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& Mipmaps() {
|
||||
::ImageMipmaps(this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& Dither(int rBpp, int gBpp, int bBpp, int aBpp) {
|
||||
::ImageDither(this, rBpp, gBpp, bBpp, aBpp);
|
||||
return *this;
|
||||
@@ -202,18 +210,22 @@ namespace raylib {
|
||||
::ImageRotateCW(this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& RotateCCW() {
|
||||
::ImageRotateCCW(this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& ColorTint(::Color color = WHITE) {
|
||||
::ImageColorTint(this, color);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& ColorInvert() {
|
||||
::ImageColorInvert(this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Image& ColorGrayscale() {
|
||||
::ImageColorGrayscale(this);
|
||||
return *this;
|
||||
|
||||
@@ -157,8 +157,9 @@ namespace raylib {
|
||||
}
|
||||
};
|
||||
|
||||
// Alias the Texture2D as Texture.
|
||||
// Create the Texture2D aliases.
|
||||
typedef Texture2D Texture;
|
||||
typedef Texture2D TextureCubemap;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace raylib {
|
||||
VrSimulator() {
|
||||
Init();
|
||||
};
|
||||
VrSimulator(VrDeviceInfo info, Shader distortion) {
|
||||
VrSimulator(::VrDeviceInfo info, ::Shader distortion) {
|
||||
Init();
|
||||
Set(info, distortion);
|
||||
};
|
||||
@@ -38,7 +38,7 @@ namespace raylib {
|
||||
::UpdateVrTracking(camera);
|
||||
return *this;
|
||||
}
|
||||
inline VrSimulator& Set(VrDeviceInfo info, Shader distortion) {
|
||||
inline VrSimulator& Set(::VrDeviceInfo info, ::Shader distortion) {
|
||||
::SetVrConfiguration(info, distortion);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user