i tried drawing a texture but it didn't show anything:
#include "raylib.h"
#include "string"
int main()
{
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "Texture Location Example");
Texture2D texture = LoadTexture("/Users/stavanmukherjee./Downloads/raylib-master 2/build/raylib-cpp/projects/VSCode/raylib-cpp-starter/src/triangle.png");
Vector2 center = { static_cast<float>(texture.width / 2.0), static_cast<float>(texture.height / 2.0) };
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawTexturePro(texture, { 0.0f, 0.0f, static_cast<float>(texture.width), static_cast<float>(texture.height) },
{ screenWidth / 2.0f, screenHeight / 2.0f }, center, 0.0f, BLACK);
std::string text = "Texture Location: (" + std::to_string(screenWidth / 2.0f - center.x) + ", " + std::to_string(screenHeight / 2.0f - center.y) + ")";
DrawText(text.c_str(), 10, 10, 20, BLACK);
EndDrawing();
}
UnloadTexture(texture);
CloseWindow();
return 0;
}
ps:(it showed the texture was rendering in the right place but it wasent showing. I am also using the raylib-cpp-starter library)