Merge branch 'master' of github.com:raysan5/raylib
This commit is contained in:
commit
8235c10364
25 changed files with 490 additions and 407 deletions
|
|
@ -97,7 +97,7 @@ int main(void)
|
||||||
DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
|
DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
|
||||||
for (int i = 0; i < 400; i++)
|
for (int i = 0; i < 400; i++)
|
||||||
{
|
{
|
||||||
DrawLine(201 + i, 232 - averageVolume[i] * 32, 201 + i, 232, MAROON);
|
DrawLine(201 + i, 232 - (int)averageVolume[i] * 32, 201 + i, 232, MAROON);
|
||||||
}
|
}
|
||||||
DrawRectangleLines(199, 199, 402, 34, GRAY);
|
DrawRectangleLines(199, 199, 402, 34, GRAY);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,10 +133,10 @@ int main(void)
|
||||||
|
|
||||||
for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color);
|
for (int i = 0; i < envItemsLength; i++) DrawRectangleRec(envItems[i].rect, envItems[i].color);
|
||||||
|
|
||||||
Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40, 40 };
|
Rectangle playerRect = { player.position.x - 20, player.position.y - 40, 40.0f, 40.0f };
|
||||||
DrawRectangleRec(playerRect, RED);
|
DrawRectangleRec(playerRect, RED);
|
||||||
|
|
||||||
DrawCircle(player.position.x, player.position.y, 5, GOLD);
|
DrawCircleV(player.position, 5.0f, GOLD);
|
||||||
|
|
||||||
EndMode2D();
|
EndMode2D();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
boxPositionY -= (GetMouseWheelMove()*scrollSpeed);
|
boxPositionY -= (int)(GetMouseWheelMove()*scrollSpeed);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ int main(void) {
|
||||||
|
|
||||||
int rectCount = 20;
|
int rectCount = 20;
|
||||||
float rectSize = (float)screenWidth/rectCount;
|
float rectSize = (float)screenWidth/rectCount;
|
||||||
ColorRect* rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight);
|
ColorRect* rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight);
|
||||||
|
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
@ -62,7 +62,7 @@ int main(void) {
|
||||||
rectCount++;
|
rectCount++;
|
||||||
rectSize = (float)screenWidth/rectCount;
|
rectSize = (float)screenWidth/rectCount;
|
||||||
free(rectangles);
|
free(rectangles);
|
||||||
rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight);
|
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsKeyPressed(KEY_DOWN))
|
if(IsKeyPressed(KEY_DOWN))
|
||||||
|
|
@ -71,7 +71,7 @@ int main(void) {
|
||||||
rectCount--;
|
rectCount--;
|
||||||
rectSize = (float)screenWidth/rectCount;
|
rectSize = (float)screenWidth/rectCount;
|
||||||
free(rectangles);
|
free(rectangles);
|
||||||
rectangles = GenerateRandomColorRectSequence(rectCount, rectSize, screenWidth, 0.75f * screenHeight);
|
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f * screenHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,17 +121,17 @@ static Color GenerateRandomColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight){
|
static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight){
|
||||||
int *seq = LoadRandomSequence(rectCount, 0, rectCount-1);
|
int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount-1);
|
||||||
ColorRect* rectangles = (ColorRect *)malloc(rectCount*sizeof(ColorRect));
|
ColorRect* rectangles = (ColorRect *)malloc((int)rectCount*sizeof(ColorRect));
|
||||||
|
|
||||||
float rectSeqWidth = rectCount * rectWidth;
|
float rectSeqWidth = rectCount * rectWidth;
|
||||||
int startX = (screenWidth - rectSeqWidth) * 0.5f;
|
float startX = (screenWidth - rectSeqWidth) * 0.5f;
|
||||||
|
|
||||||
for(int x=0;x<rectCount;x++){
|
for(int x=0;x<rectCount;x++){
|
||||||
int rectHeight = Remap(seq[x], 0, rectCount-1, 0, screenHeight);
|
int rectHeight = (int)Remap((float)seq[x], 0, rectCount-1, 0, screenHeight);
|
||||||
rectangles[x].c = GenerateRandomColor();
|
rectangles[x].c = GenerateRandomColor();
|
||||||
rectangles[x].r = CLITERAL(Rectangle){
|
rectangles[x].r = CLITERAL(Rectangle){
|
||||||
startX + x * rectWidth, screenHeight - rectHeight, rectWidth, rectHeight
|
startX + x * rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
UnloadRandomSequence(seq);
|
UnloadRandomSequence(seq);
|
||||||
|
|
|
||||||
|
|
@ -69,18 +69,18 @@ int main(void)
|
||||||
rotation += 60.0f*GetFrameTime(); // Rotate the rectangles, 60 degrees per second
|
rotation += 60.0f*GetFrameTime(); // Rotate the rectangles, 60 degrees per second
|
||||||
|
|
||||||
// Make the camera move to demonstrate the effect
|
// Make the camera move to demonstrate the effect
|
||||||
cameraX = (sinf(GetTime())*50.0f) - 10.0f;
|
cameraX = (sinf((float)GetTime())*50.0f) - 10.0f;
|
||||||
cameraY = cosf(GetTime())*30.0f;
|
cameraY = cosf((float)GetTime())*30.0f;
|
||||||
|
|
||||||
// Set the camera's target to the values computed above
|
// Set the camera's target to the values computed above
|
||||||
screenSpaceCamera.target = (Vector2){ cameraX, cameraY };
|
screenSpaceCamera.target = (Vector2){ cameraX, cameraY };
|
||||||
|
|
||||||
// Round worldSpace coordinates, keep decimals into screenSpace coordinates
|
// Round worldSpace coordinates, keep decimals into screenSpace coordinates
|
||||||
worldSpaceCamera.target.x = (int)screenSpaceCamera.target.x;
|
worldSpaceCamera.target.x = truncf(screenSpaceCamera.target.x);
|
||||||
screenSpaceCamera.target.x -= worldSpaceCamera.target.x;
|
screenSpaceCamera.target.x -= worldSpaceCamera.target.x;
|
||||||
screenSpaceCamera.target.x *= virtualRatio;
|
screenSpaceCamera.target.x *= virtualRatio;
|
||||||
|
|
||||||
worldSpaceCamera.target.y = (int)screenSpaceCamera.target.y;
|
worldSpaceCamera.target.y = truncf(screenSpaceCamera.target.y);
|
||||||
screenSpaceCamera.target.y -= worldSpaceCamera.target.y;
|
screenSpaceCamera.target.y -= worldSpaceCamera.target.y;
|
||||||
screenSpaceCamera.target.y *= virtualRatio;
|
screenSpaceCamera.target.y *= virtualRatio;
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ int LoadStorageValue(unsigned int position)
|
||||||
|
|
||||||
if (fileData != NULL)
|
if (fileData != NULL)
|
||||||
{
|
{
|
||||||
if (dataSize < (position*4)) TraceLog(LOG_WARNING, "FILEIO: [%s] Failed to find storage position: %i", STORAGE_DATA_FILE, position);
|
if (dataSize < ((int)(position*4))) TraceLog(LOG_WARNING, "FILEIO: [%s] Failed to find storage position: %i", STORAGE_DATA_FILE, position);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int *dataPtr = (int *)fileData;
|
int *dataPtr = (int *)fileData;
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ int main(void)
|
||||||
DrawCubeTexture(texture, (Vector3){ -2.0f, 2.0f, 0.0f }, 2.0f, 4.0f, 2.0f, WHITE);
|
DrawCubeTexture(texture, (Vector3){ -2.0f, 2.0f, 0.0f }, 2.0f, 4.0f, 2.0f, WHITE);
|
||||||
|
|
||||||
// Draw cube with an applied texture, but only a defined rectangle piece of the texture
|
// Draw cube with an applied texture, but only a defined rectangle piece of the texture
|
||||||
DrawCubeTextureRec(texture, (Rectangle){ 0, texture.height/2, texture.width/2, texture.height/2 },
|
DrawCubeTextureRec(texture, (Rectangle){ 0.0f, texture.height/2.0f, texture.width/2.0f, texture.height/2.0f },
|
||||||
(Vector3){ 2.0f, 1.0f, 0.0f }, 2.0f, 2.0f, 2.0f, WHITE);
|
(Vector3){ 2.0f, 1.0f, 0.0f }, 2.0f, 2.0f, 2.0f, WHITE);
|
||||||
|
|
||||||
DrawGrid(10, 1.0f); // Draw a grid
|
DrawGrid(10, 1.0f); // Draw a grid
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ int main(void)
|
||||||
.id = gBuffer.positionTexture,
|
.id = gBuffer.positionTexture,
|
||||||
.width = screenWidth,
|
.width = screenWidth,
|
||||||
.height = screenHeight,
|
.height = screenHeight,
|
||||||
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
}, (Rectangle) { 0, 0, (float)screenWidth, (float)-screenHeight }, Vector2Zero(), RAYWHITE);
|
||||||
|
|
||||||
DrawText("POSITION TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("POSITION TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
|
@ -291,7 +291,7 @@ int main(void)
|
||||||
.id = gBuffer.normalTexture,
|
.id = gBuffer.normalTexture,
|
||||||
.width = screenWidth,
|
.width = screenWidth,
|
||||||
.height = screenHeight,
|
.height = screenHeight,
|
||||||
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
}, (Rectangle) { 0, 0, (float)screenWidth, (float)-screenHeight }, Vector2Zero(), RAYWHITE);
|
||||||
|
|
||||||
DrawText("NORMAL TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("NORMAL TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
|
@ -301,7 +301,7 @@ int main(void)
|
||||||
.id = gBuffer.albedoSpecTexture,
|
.id = gBuffer.albedoSpecTexture,
|
||||||
.width = screenWidth,
|
.width = screenWidth,
|
||||||
.height = screenHeight,
|
.height = screenHeight,
|
||||||
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
}, (Rectangle) { 0, 0, (float)screenWidth, (float)-screenHeight }, Vector2Zero(), RAYWHITE);
|
||||||
|
|
||||||
DrawText("ALBEDO TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("ALBEDO TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ int main(void)
|
||||||
DrawLineBezier(startPoint, endPoint, 4.0f, BLUE);
|
DrawLineBezier(startPoint, endPoint, 4.0f, BLUE);
|
||||||
|
|
||||||
// Draw start-end spline circles with some details
|
// Draw start-end spline circles with some details
|
||||||
DrawCircleV(startPoint, CheckCollisionPointCircle(mouse, startPoint, 10.0f)? 14 : 8, moveStartPoint? RED : BLUE);
|
DrawCircleV(startPoint, CheckCollisionPointCircle(mouse, startPoint, 10.0f)? 14.0f : 8.0f, moveStartPoint? RED : BLUE);
|
||||||
DrawCircleV(endPoint, CheckCollisionPointCircle(mouse, endPoint, 10.0f)? 14 : 8, moveEndPoint? RED : BLUE);
|
DrawCircleV(endPoint, CheckCollisionPointCircle(mouse, endPoint, 10.0f)? 14.0f : 8.0f, moveEndPoint? RED : BLUE);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ int main(void)
|
||||||
(splineTypeActive != SPLINE_BEZIER) &&
|
(splineTypeActive != SPLINE_BEZIER) &&
|
||||||
(i < pointCount - 1)) DrawLineV(points[i], points[i + 1], GRAY);
|
(i < pointCount - 1)) DrawLineV(points[i], points[i + 1], GRAY);
|
||||||
|
|
||||||
DrawText(TextFormat("[%.0f, %.0f]", points[i].x, points[i].y), points[i].x, points[i].y + 10, 10, BLACK);
|
DrawText(TextFormat("[%.0f, %.0f]", points[i].x, points[i].y), (int)points[i].x, (int)points[i].y + 10, 10, BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7351,7 +7351,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ImageKernelConvolution",
|
"name": "ImageKernelConvolution",
|
||||||
"description": "Apply Custom Square image convolution kernel",
|
"description": "Apply custom square convolution kernel to image",
|
||||||
"returnType": "void",
|
"returnType": "void",
|
||||||
"params": [
|
"params": [
|
||||||
{
|
{
|
||||||
|
|
@ -7359,7 +7359,7 @@
|
||||||
"name": "image"
|
"name": "image"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "float *",
|
"type": "const float *",
|
||||||
"name": "kernel"
|
"name": "kernel"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -7817,6 +7817,33 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ImageDrawLineEx",
|
||||||
|
"description": "Draw a line defining thickness within an image",
|
||||||
|
"returnType": "void",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"type": "Image *",
|
||||||
|
"name": "dst"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Vector2",
|
||||||
|
"name": "start"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Vector2",
|
||||||
|
"name": "end"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "int",
|
||||||
|
"name": "thick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Color",
|
||||||
|
"name": "color"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ImageDrawCircle",
|
"name": "ImageDrawCircle",
|
||||||
"description": "Draw a filled circle within an image",
|
"description": "Draw a filled circle within an image",
|
||||||
|
|
|
||||||
|
|
@ -5617,11 +5617,11 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "ImageKernelConvolution",
|
name = "ImageKernelConvolution",
|
||||||
description = "Apply Custom Square image convolution kernel",
|
description = "Apply custom square convolution kernel to image",
|
||||||
returnType = "void",
|
returnType = "void",
|
||||||
params = {
|
params = {
|
||||||
{type = "Image *", name = "image"},
|
{type = "Image *", name = "image"},
|
||||||
{type = "float *", name = "kernel"},
|
{type = "const float *", name = "kernel"},
|
||||||
{type = "int", name = "kernelSize"}
|
{type = "int", name = "kernelSize"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -5879,6 +5879,18 @@ return {
|
||||||
{type = "Color", name = "color"}
|
{type = "Color", name = "color"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "ImageDrawLineEx",
|
||||||
|
description = "Draw a line defining thickness within an image",
|
||||||
|
returnType = "void",
|
||||||
|
params = {
|
||||||
|
{type = "Image *", name = "dst"},
|
||||||
|
{type = "Vector2", name = "start"},
|
||||||
|
{type = "Vector2", name = "end"},
|
||||||
|
{type = "int", name = "thick"},
|
||||||
|
{type = "Color", name = "color"}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "ImageDrawCircle",
|
name = "ImageDrawCircle",
|
||||||
description = "Draw a filled circle within an image",
|
description = "Draw a filled circle within an image",
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -670,7 +670,7 @@
|
||||||
<Param type="unsigned int" name="frames" desc="" />
|
<Param type="unsigned int" name="frames" desc="" />
|
||||||
</Callback>
|
</Callback>
|
||||||
</Callbacks>
|
</Callbacks>
|
||||||
<Functions count="571">
|
<Functions count="572">
|
||||||
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
|
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
|
||||||
<Param type="int" name="width" desc="" />
|
<Param type="int" name="width" desc="" />
|
||||||
<Param type="int" name="height" desc="" />
|
<Param type="int" name="height" desc="" />
|
||||||
|
|
@ -1842,9 +1842,9 @@
|
||||||
<Param type="Image *" name="image" desc="" />
|
<Param type="Image *" name="image" desc="" />
|
||||||
<Param type="int" name="blurSize" desc="" />
|
<Param type="int" name="blurSize" desc="" />
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="ImageKernelConvolution" retType="void" paramCount="3" desc="Apply Custom Square image convolution kernel">
|
<Function name="ImageKernelConvolution" retType="void" paramCount="3" desc="Apply custom square convolution kernel to image">
|
||||||
<Param type="Image *" name="image" desc="" />
|
<Param type="Image *" name="image" desc="" />
|
||||||
<Param type="float *" name="kernel" desc="" />
|
<Param type="const float *" name="kernel" desc="" />
|
||||||
<Param type="int" name="kernelSize" desc="" />
|
<Param type="int" name="kernelSize" desc="" />
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="ImageResize" retType="void" paramCount="3" desc="Resize image (Bicubic scaling algorithm)">
|
<Function name="ImageResize" retType="void" paramCount="3" desc="Resize image (Bicubic scaling algorithm)">
|
||||||
|
|
@ -1966,6 +1966,13 @@
|
||||||
<Param type="Vector2" name="end" desc="" />
|
<Param type="Vector2" name="end" desc="" />
|
||||||
<Param type="Color" name="color" desc="" />
|
<Param type="Color" name="color" desc="" />
|
||||||
</Function>
|
</Function>
|
||||||
|
<Function name="ImageDrawLineEx" retType="void" paramCount="5" desc="Draw a line defining thickness within an image">
|
||||||
|
<Param type="Image *" name="dst" desc="" />
|
||||||
|
<Param type="Vector2" name="start" desc="" />
|
||||||
|
<Param type="Vector2" name="end" desc="" />
|
||||||
|
<Param type="int" name="thick" desc="" />
|
||||||
|
<Param type="Color" name="color" desc="" />
|
||||||
|
</Function>
|
||||||
<Function name="ImageDrawCircle" retType="void" paramCount="5" desc="Draw a filled circle within an image">
|
<Function name="ImageDrawCircle" retType="void" paramCount="5" desc="Draw a filled circle within an image">
|
||||||
<Param type="Image *" name="dst" desc="" />
|
<Param type="Image *" name="dst" desc="" />
|
||||||
<Param type="int" name="centerX" desc="" />
|
<Param type="int" name="centerX" desc="" />
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
|
@ -237,7 +237,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -258,7 +258,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -281,7 +281,7 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||||
|
|
@ -303,7 +303,7 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||||
|
|
@ -325,7 +325,7 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||||
|
|
@ -353,7 +353,7 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<CompileAs>CompileAsC</CompileAs>
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,14 @@ comptime {
|
||||||
// get the flags a second time when adding raygui
|
// get the flags a second time when adding raygui
|
||||||
var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{};
|
var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{};
|
||||||
|
|
||||||
|
/// we're not inside the actual build script recognized by the
|
||||||
|
/// zig build system; use this type where one would otherwise
|
||||||
|
/// use `@This()` when inside the actual entrypoint file.
|
||||||
|
const BuildScript = @import("../build.zig");
|
||||||
|
|
||||||
// This has been tested with zig version 0.12.0
|
// This has been tested with zig version 0.12.0
|
||||||
pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
|
pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
|
||||||
const raylib_dep = b.dependency(options.raylib_dependency_name, .{
|
const raylib_dep = b.dependencyFromBuildZig(BuildScript, .{
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.raudio = options.raudio,
|
.raudio = options.raudio,
|
||||||
|
|
@ -257,7 +262,6 @@ pub const Options = struct {
|
||||||
linux_display_backend: LinuxDisplayBackend = .X11,
|
linux_display_backend: LinuxDisplayBackend = .X11,
|
||||||
opengl_version: OpenglVersion = .auto,
|
opengl_version: OpenglVersion = .auto,
|
||||||
|
|
||||||
raylib_dependency_name: []const u8 = "raylib",
|
|
||||||
raygui_dependency_name: []const u8 = "raygui",
|
raygui_dependency_name: []const u8 = "raygui",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,11 @@
|
||||||
<link rel="shortcut icon" href="https://www.raylib.com/favicon.ico">
|
<link rel="shortcut icon" href="https://www.raylib.com/favicon.ico">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body { margin: 0px; }
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
canvas.emscripten { border: 0px none; background-color: black;}
|
canvas.emscripten { border: 0px none; background-color: black;}
|
||||||
</style>
|
</style>
|
||||||
<script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script>
|
<script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script>
|
||||||
|
|
|
||||||
|
|
@ -1342,7 +1342,7 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold);
|
||||||
RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
||||||
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||||
RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
|
RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
|
||||||
RLAPI void ImageKernelConvolution(Image *image, float *kernel, int kernelSize); // Apply Custom Square image convolution kernel
|
RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image
|
||||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
||||||
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||||
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
||||||
|
|
@ -1373,6 +1373,7 @@ RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color);
|
||||||
RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
|
RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
|
||||||
RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
|
RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
|
||||||
RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
|
RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
|
||||||
|
RLAPI void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image
|
||||||
RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image
|
RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image
|
||||||
RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version)
|
RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version)
|
||||||
RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image
|
RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image
|
||||||
|
|
|
||||||
|
|
@ -856,7 +856,7 @@ void EndDrawing(void)
|
||||||
#ifndef GIF_RECORD_FRAMERATE
|
#ifndef GIF_RECORD_FRAMERATE
|
||||||
#define GIF_RECORD_FRAMERATE 10
|
#define GIF_RECORD_FRAMERATE 10
|
||||||
#endif
|
#endif
|
||||||
gifFrameCounter += GetFrameTime()*1000;
|
gifFrameCounter += (unsigned int)(GetFrameTime()*1000);
|
||||||
|
|
||||||
// NOTE: We record one gif frame depending on the desired gif framerate
|
// NOTE: We record one gif frame depending on the desired gif framerate
|
||||||
if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE)
|
if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE)
|
||||||
|
|
|
||||||
|
|
@ -1406,7 +1406,7 @@ void rlBegin(int mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rlEnd() { glEnd(); }
|
void rlEnd(void) { glEnd(); }
|
||||||
void rlVertex2i(int x, int y) { glVertex2i(x, y); }
|
void rlVertex2i(int x, int y) { glVertex2i(x, y); }
|
||||||
void rlVertex2f(float x, float y) { glVertex2f(x, y); }
|
void rlVertex2f(float x, float y) { glVertex2f(x, y); }
|
||||||
void rlVertex3f(float x, float y, float z) { glVertex3f(x, y, z); }
|
void rlVertex3f(float x, float y, float z) { glVertex3f(x, y, z); }
|
||||||
|
|
@ -3945,7 +3945,9 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma
|
||||||
// Additional types (depends on OpenGL version or extensions):
|
// Additional types (depends on OpenGL version or extensions):
|
||||||
// - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED,
|
// - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED,
|
||||||
// - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV
|
// - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV
|
||||||
glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offset);
|
|
||||||
|
size_t offsetNative = offset;
|
||||||
|
glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offsetNative);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue