Merge branch 'raysan5:master' into master
This commit is contained in:
commit
2e2d0cbd2b
9 changed files with 11329 additions and 10693 deletions
|
@ -52,6 +52,8 @@ int main(void)
|
|||
DrawCircle(screenWidth/5, 120, 35, DARKBLUE);
|
||||
DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE);
|
||||
DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE);
|
||||
DrawEllipse(screenWidth/5, 120, 25, 20, YELLOW);
|
||||
DrawEllipseLines(screenWidth/5, 120, 30, 25, YELLOW);
|
||||
|
||||
// Rectangle shapes and lines
|
||||
DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED);
|
||||
|
|
|
@ -5702,6 +5702,29 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawEllipseV",
|
||||
"description": "Draw ellipse (Vector version)",
|
||||
"returnType": "void",
|
||||
"params": [
|
||||
{
|
||||
"type": "Vector2",
|
||||
"name": "center"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "radiusH"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "radiusV"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawEllipseLines",
|
||||
"description": "Draw ellipse outline",
|
||||
|
@ -5729,6 +5752,29 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawEllipseLinesV",
|
||||
"description": "Draw ellipse outline (Vector version)",
|
||||
"returnType": "void",
|
||||
"params": [
|
||||
{
|
||||
"type": "Vector2",
|
||||
"name": "center"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "radiusH"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "radiusV"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawRing",
|
||||
"description": "Draw ring",
|
||||
|
|
|
@ -4838,6 +4838,17 @@ return {
|
|||
{type = "Color", name = "color"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawEllipseV",
|
||||
description = "Draw ellipse (Vector version)",
|
||||
returnType = "void",
|
||||
params = {
|
||||
{type = "Vector2", name = "center"},
|
||||
{type = "float", name = "radiusH"},
|
||||
{type = "float", name = "radiusV"},
|
||||
{type = "Color", name = "color"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawEllipseLines",
|
||||
description = "Draw ellipse outline",
|
||||
|
@ -4850,6 +4861,17 @@ return {
|
|||
{type = "Color", name = "color"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawEllipseLinesV",
|
||||
description = "Draw ellipse outline (Vector version)",
|
||||
returnType = "void",
|
||||
params = {
|
||||
{type = "Vector2", name = "center"},
|
||||
{type = "float", name = "radiusH"},
|
||||
{type = "float", name = "radiusV"},
|
||||
{type = "Color", name = "color"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawRing",
|
||||
description = "Draw ring",
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -679,7 +679,7 @@
|
|||
<Param type="unsigned int" name="frames" desc="" />
|
||||
</Callback>
|
||||
</Callbacks>
|
||||
<Functions count="582">
|
||||
<Functions count="584">
|
||||
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
|
@ -1409,6 +1409,12 @@
|
|||
<Param type="float" name="radiusV" desc="" />
|
||||
<Param type="Color" name="color" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawEllipseV" retType="void" paramCount="4" desc="Draw ellipse (Vector version)">
|
||||
<Param type="Vector2" name="center" desc="" />
|
||||
<Param type="float" name="radiusH" desc="" />
|
||||
<Param type="float" name="radiusV" desc="" />
|
||||
<Param type="Color" name="color" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawEllipseLines" retType="void" paramCount="5" desc="Draw ellipse outline">
|
||||
<Param type="int" name="centerX" desc="" />
|
||||
<Param type="int" name="centerY" desc="" />
|
||||
|
@ -1416,6 +1422,12 @@
|
|||
<Param type="float" name="radiusV" desc="" />
|
||||
<Param type="Color" name="color" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawEllipseLinesV" retType="void" paramCount="4" desc="Draw ellipse outline (Vector version)">
|
||||
<Param type="Vector2" name="center" desc="" />
|
||||
<Param type="float" name="radiusH" desc="" />
|
||||
<Param type="float" name="radiusV" desc="" />
|
||||
<Param type="Color" name="color" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRing" retType="void" paramCount="7" desc="Draw ring">
|
||||
<Param type="Vector2" name="center" desc="" />
|
||||
<Param type="float" name="innerRadius" desc="" />
|
||||
|
|
21158
src/external/RGFW.h
vendored
21158
src/external/RGFW.h
vendored
File diff suppressed because it is too large
Load diff
|
@ -177,6 +177,7 @@ static const unsigned short keyMappingRGFW[] = {
|
|||
[RGFW_shiftR] = KEY_RIGHT_SHIFT,
|
||||
[RGFW_controlR] = KEY_RIGHT_CONTROL,
|
||||
[RGFW_altR] = KEY_RIGHT_ALT,
|
||||
[RGFW_superR] = KEY_RIGHT_SUPER,
|
||||
#endif
|
||||
[RGFW_space] = KEY_SPACE,
|
||||
|
||||
|
@ -584,7 +585,7 @@ void SetWindowPosition(int x, int y)
|
|||
// Set monitor for the current window
|
||||
void SetWindowMonitor(int monitor)
|
||||
{
|
||||
RGFW_window_moveToMonitor(platform.window, RGFW_getMonitors()[monitor]);
|
||||
RGFW_window_moveToMonitor(platform.window, RGFW_getMonitors(NULL)[monitor]);
|
||||
}
|
||||
|
||||
// Set window minimum dimensions (FLAG_WINDOW_RESIZABLE)
|
||||
|
@ -641,7 +642,7 @@ int GetMonitorCount(void)
|
|||
#define MAX_MONITORS_SUPPORTED 6
|
||||
|
||||
int count = MAX_MONITORS_SUPPORTED;
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
|
@ -658,7 +659,7 @@ int GetMonitorCount(void)
|
|||
// Get current monitor where window is placed
|
||||
int GetCurrentMonitor(void)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
RGFW_monitor mon = { 0 };
|
||||
|
||||
if (platform.window) mon = RGFW_window_getMonitor(platform.window);
|
||||
|
@ -675,7 +676,7 @@ int GetCurrentMonitor(void)
|
|||
// Get selected monitor position
|
||||
Vector2 GetMonitorPosition(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return (Vector2){ (float)mons[monitor].x, (float)mons[monitor].y };
|
||||
}
|
||||
|
@ -683,7 +684,7 @@ Vector2 GetMonitorPosition(int monitor)
|
|||
// Get selected monitor width (currently used by monitor)
|
||||
int GetMonitorWidth(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return mons[monitor].mode.area.w;
|
||||
}
|
||||
|
@ -691,7 +692,7 @@ int GetMonitorWidth(int monitor)
|
|||
// Get selected monitor height (currently used by monitor)
|
||||
int GetMonitorHeight(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return mons[monitor].mode.area.h;
|
||||
}
|
||||
|
@ -699,7 +700,7 @@ int GetMonitorHeight(int monitor)
|
|||
// Get selected monitor physical width in millimetres
|
||||
int GetMonitorPhysicalWidth(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return mons[monitor].physW;
|
||||
}
|
||||
|
@ -707,7 +708,7 @@ int GetMonitorPhysicalWidth(int monitor)
|
|||
// Get selected monitor physical height in millimetres
|
||||
int GetMonitorPhysicalHeight(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return (int)mons[monitor].physH;
|
||||
}
|
||||
|
@ -715,7 +716,7 @@ int GetMonitorPhysicalHeight(int monitor)
|
|||
// Get selected monitor refresh rate
|
||||
int GetMonitorRefreshRate(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return (int)mons[monitor].mode.refreshRate;
|
||||
}
|
||||
|
@ -723,7 +724,7 @@ int GetMonitorRefreshRate(int monitor)
|
|||
// Get the human-readable, UTF-8 encoded name of the selected monitor
|
||||
const char *GetMonitorName(int monitor)
|
||||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
RGFW_monitor *mons = RGFW_getMonitors(NULL);
|
||||
|
||||
return mons[monitor].name;
|
||||
}
|
||||
|
@ -1320,6 +1321,13 @@ int InitPlatform(void)
|
|||
platform.window = RGFW_createWindow(CORE.Window.title, RGFW_RECT(0, 0, CORE.Window.screen.width, CORE.Window.screen.height), flags);
|
||||
platform.mon.mode.area.w = 0;
|
||||
|
||||
if (platform.window != NULL)
|
||||
{
|
||||
// NOTE: RGFW's exit key is distinct from raylib's exit key (which can
|
||||
// be set with SetExitKey()) and defaults to Escape
|
||||
platform.window->exitKey = RGFW_keyNULL;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_WEB_RGFW
|
||||
RGFW_area screenSize = RGFW_getScreenSize();
|
||||
CORE.Window.display.width = screenSize.w;
|
||||
|
|
|
@ -1264,7 +1264,9 @@ RLAPI void DrawCircleV(Vector2 center, float radius, Color color);
|
|||
RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
|
||||
RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version)
|
||||
RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
|
||||
RLAPI void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse (Vector version)
|
||||
RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
|
||||
RLAPI void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color); // Draw ellipse outline (Vector version)
|
||||
RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
|
||||
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
|
||||
RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
|
||||
|
|
|
@ -470,27 +470,39 @@ void DrawCircleLinesV(Vector2 center, float radius, Color color)
|
|||
|
||||
// Draw ellipse
|
||||
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color)
|
||||
{
|
||||
DrawEllipseV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color);
|
||||
}
|
||||
|
||||
// Draw ellipse (Vector version)
|
||||
void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color)
|
||||
{
|
||||
rlBegin(RL_TRIANGLES);
|
||||
for (int i = 0; i < 360; i += 10)
|
||||
{
|
||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||
rlVertex2f((float)centerX, (float)centerY);
|
||||
rlVertex2f((float)centerX + cosf(DEG2RAD*(i + 10))*radiusH, (float)centerY + sinf(DEG2RAD*(i + 10))*radiusV);
|
||||
rlVertex2f((float)centerX + cosf(DEG2RAD*i)*radiusH, (float)centerY + sinf(DEG2RAD*i)*radiusV);
|
||||
rlVertex2f(center.x, center.y);
|
||||
rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV);
|
||||
rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV);
|
||||
}
|
||||
rlEnd();
|
||||
}
|
||||
|
||||
// Draw ellipse outline
|
||||
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color)
|
||||
{
|
||||
DrawEllipseLinesV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color);
|
||||
}
|
||||
|
||||
// Draw ellipse outline
|
||||
void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color)
|
||||
{
|
||||
rlBegin(RL_LINES);
|
||||
for (int i = 0; i < 360; i += 10)
|
||||
{
|
||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||
rlVertex2f(centerX + cosf(DEG2RAD*(i + 10))*radiusH, centerY + sinf(DEG2RAD*(i + 10))*radiusV);
|
||||
rlVertex2f(centerX + cosf(DEG2RAD*i)*radiusH, centerY + sinf(DEG2RAD*i)*radiusV);
|
||||
rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV);
|
||||
rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV);
|
||||
}
|
||||
rlEnd();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue