webrogue support
This commit is contained in:
parent
b432aa2b9c
commit
a362ad1001
|
|
@ -44,7 +44,11 @@ if (${PLATFORM} MATCHES "Desktop")
|
||||||
set(OPENGL_LIBRARIES "GL")
|
set(OPENGL_LIBRARIES "GL")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(LIBS_PRIVATE m atomic pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WASI")
|
||||||
|
set(LIBS_PRIVATE m atomic)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
||||||
|
|
||||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
|
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
|
||||||
find_library(OSS_LIBRARY ossaudio)
|
find_library(OSS_LIBRARY ossaudio)
|
||||||
|
|
|
||||||
|
|
@ -4599,6 +4599,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
|
||||||
}
|
}
|
||||||
|
|
||||||
rlSetTexture(texture.id);
|
rlSetTexture(texture.id);
|
||||||
|
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
||||||
rlBegin(RL_QUADS);
|
rlBegin(RL_QUADS);
|
||||||
|
|
||||||
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
|
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
|
||||||
|
|
@ -4625,7 +4626,6 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
|
||||||
rlVertex2f(topRight.x, topRight.y);
|
rlVertex2f(topRight.x, topRight.y);
|
||||||
|
|
||||||
rlEnd();
|
rlEnd();
|
||||||
rlSetTexture(0);
|
|
||||||
|
|
||||||
// NOTE: Vertex position can be transformed using matrices
|
// NOTE: Vertex position can be transformed using matrices
|
||||||
// but the process is way more costly than just calculating
|
// but the process is way more costly than just calculating
|
||||||
|
|
@ -4633,7 +4633,6 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
|
||||||
// I leave here the old implementation for educational purposes,
|
// I leave here the old implementation for educational purposes,
|
||||||
// just in case someone wants to do some performance test
|
// just in case someone wants to do some performance test
|
||||||
/*
|
/*
|
||||||
rlSetTexture(texture.id);
|
|
||||||
rlPushMatrix();
|
rlPushMatrix();
|
||||||
rlTranslatef(dest.x, dest.y, 0.0f);
|
rlTranslatef(dest.x, dest.y, 0.0f);
|
||||||
if (rotation != 0.0f) rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
|
if (rotation != 0.0f) rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
@ -4664,8 +4663,47 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
|
||||||
rlVertex2f(dest.width, 0.0f);
|
rlVertex2f(dest.width, 0.0f);
|
||||||
rlEnd();
|
rlEnd();
|
||||||
rlPopMatrix();
|
rlPopMatrix();
|
||||||
rlSetTexture(0);
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#else
|
||||||
|
rlBegin(RL_TRIANGLES);
|
||||||
|
|
||||||
|
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
|
||||||
|
rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer
|
||||||
|
|
||||||
|
// Top-left corner for texture
|
||||||
|
if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height);
|
||||||
|
else rlTexCoord2f(source.x/width, source.y/height);
|
||||||
|
rlVertex2f(topLeft.x, topLeft.y);
|
||||||
|
|
||||||
|
// Bottom-left corner for texture
|
||||||
|
if (flipX) rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height);
|
||||||
|
else rlTexCoord2f(source.x/width, (source.y + source.height)/height);
|
||||||
|
rlVertex2f(bottomLeft.x, bottomLeft.y);
|
||||||
|
|
||||||
|
// Bottom-right corner for texture
|
||||||
|
if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height);
|
||||||
|
else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height);
|
||||||
|
rlVertex2f(bottomRight.x, bottomRight.y);
|
||||||
|
|
||||||
|
// Top-left corner for texture
|
||||||
|
if (flipX) rlTexCoord2f((source.x + source.width)/width, source.y/height);
|
||||||
|
else rlTexCoord2f(source.x/width, source.y/height);
|
||||||
|
rlVertex2f(topLeft.x, topLeft.y);
|
||||||
|
|
||||||
|
// Bottom-right corner for texture
|
||||||
|
if (flipX) rlTexCoord2f(source.x/width, (source.y + source.height)/height);
|
||||||
|
else rlTexCoord2f((source.x + source.width)/width, (source.y + source.height)/height);
|
||||||
|
rlVertex2f(bottomRight.x, bottomRight.y);
|
||||||
|
|
||||||
|
// Top-right corner for texture
|
||||||
|
if (flipX) rlTexCoord2f(source.x/width, source.y/height);
|
||||||
|
else rlTexCoord2f((source.x + source.width)/width, source.y/height);
|
||||||
|
rlVertex2f(topRight.x, topRight.y);
|
||||||
|
|
||||||
|
rlEnd();
|
||||||
|
#endif
|
||||||
|
rlSetTexture(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user