REVIEWED: Code/Web-Makefile formatting
This commit is contained in:
parent
43db59d1aa
commit
a1896c7a90
9 changed files with 302 additions and 269 deletions
|
@ -338,12 +338,12 @@ ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_R
|
|||
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||
# -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading
|
||||
# -sMINIFY_HTML=0 # minify generated html from shell.html
|
||||
# --profiling # include information for code profiling
|
||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||
# --preload-file resources # specify a resources folder for data compilation
|
||||
# --source-map-base # allow debugging in browser with source map
|
||||
|
||||
# --shell-file shell.html # define a custom shell .html and output extension
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
|
||||
LDFLAGS += -sUSE_GLFW=3
|
||||
endif
|
||||
|
@ -547,10 +547,11 @@ SHAPES = \
|
|||
shapes/shapes_lines_bezier \
|
||||
shapes/shapes_logo_raylib \
|
||||
shapes/shapes_logo_raylib_anim \
|
||||
shapes/shapes_rectangle_advanced \
|
||||
shapes/shapes_rectangle_scaling \
|
||||
shapes/shapes_splines_drawing \
|
||||
shapes/shapes_top_down_lights \
|
||||
shapes/shapes_rectangle_advanced
|
||||
shapes/shapes_top_down_lights
|
||||
|
||||
|
||||
TEXTURES = \
|
||||
textures/textures_background_scrolling \
|
||||
|
@ -603,6 +604,7 @@ MODELS = \
|
|||
models/models_draw_cube_texture \
|
||||
models/models_first_person_maze \
|
||||
models/models_geometric_shapes \
|
||||
models/models_gpu_skinning \
|
||||
models/models_heightmap \
|
||||
models/models_loading \
|
||||
models/models_loading_gltf \
|
||||
|
@ -614,9 +616,9 @@ MODELS = \
|
|||
models/models_point_rendering \
|
||||
models/models_rlgl_solar_system \
|
||||
models/models_skybox \
|
||||
models/models_tesseract_view \
|
||||
models/models_waving_cubes \
|
||||
models/models_yaw_pitch_roll \
|
||||
models/models_gpu_skinning
|
||||
models/models_yaw_pitch_roll
|
||||
|
||||
SHADERS = \
|
||||
shaders/shaders_basic_lighting \
|
||||
|
|
|
@ -274,17 +274,17 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
|||
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||
# -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading
|
||||
# -sMINIFY_HTML=0 # minify generated html from shell.html
|
||||
# --profiling # include information for code profiling
|
||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||
# --preload-file resources # specify a resources folder for data compilation
|
||||
# --source-map-base # allow debugging in browser with source map
|
||||
|
||||
# --shell-file shell.html # define a custom shell .html and output extension
|
||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||
LDFLAGS += -sUSE_GLFW=3
|
||||
endif
|
||||
|
||||
LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall
|
||||
LDFLAGS += -sEXPORTED_RUNTIME_METHODS=ccall -s
|
||||
|
||||
# Build using asyncify
|
||||
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
|
||||
|
@ -428,10 +428,10 @@ SHAPES = \
|
|||
shapes/shapes_lines_bezier \
|
||||
shapes/shapes_logo_raylib \
|
||||
shapes/shapes_logo_raylib_anim \
|
||||
shapes/shapes_rectangle_advanced \
|
||||
shapes/shapes_rectangle_scaling \
|
||||
shapes/shapes_splines_drawing \
|
||||
shapes/shapes_top_down_lights \
|
||||
shapes/shapes_rectangle_advanced
|
||||
shapes/shapes_top_down_lights
|
||||
|
||||
TEXTURES = \
|
||||
textures/textures_background_scrolling \
|
||||
|
@ -477,7 +477,6 @@ TEXT = \
|
|||
|
||||
MODELS = \
|
||||
models/models_animation \
|
||||
models/models_gpu_skinning \
|
||||
models/models_billboard \
|
||||
models/models_bone_socket \
|
||||
models/models_box_collisions \
|
||||
|
@ -485,6 +484,7 @@ MODELS = \
|
|||
models/models_draw_cube_texture \
|
||||
models/models_first_person_maze \
|
||||
models/models_geometric_shapes \
|
||||
models/models_gpu_skinning \
|
||||
models/models_heightmap \
|
||||
models/models_loading \
|
||||
models/models_loading_gltf \
|
||||
|
@ -496,6 +496,7 @@ MODELS = \
|
|||
models/models_point_rendering \
|
||||
models/models_rlgl_solar_system \
|
||||
models/models_skybox \
|
||||
models/models_tesseract_view \
|
||||
models/models_waving_cubes \
|
||||
models/models_yaw_pitch_roll
|
||||
|
||||
|
@ -524,8 +525,8 @@ SHADERS = \
|
|||
shaders/shaders_texture_outline \
|
||||
shaders/shaders_texture_tiling \
|
||||
shaders/shaders_texture_waves \
|
||||
shaders/shaders_write_depth \
|
||||
shaders/shaders_vertex_displacement
|
||||
shaders/shaders_vertex_displacement \
|
||||
shaders/shaders_write_depth
|
||||
|
||||
AUDIO = \
|
||||
audio/audio_mixed_processor \
|
||||
|
@ -998,6 +999,9 @@ models/models_skybox: models/models_skybox.c
|
|||
--preload-file models/resources/shaders/glsl100/cubemap.vs@resources/shaders/glsl100/cubemap.vs \
|
||||
--preload-file models/resources/shaders/glsl100/cubemap.fs@resources/shaders/glsl100/cubemap.fs
|
||||
|
||||
models/models_tesseract_view: models/models_tesseract_view.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
|
||||
models/models_waving_cubes: models/models_waving_cubes.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ typedef struct ColorRect{
|
|||
Rectangle r;
|
||||
} ColorRect;
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module functions declaration
|
||||
//------------------------------------------------------------------------------------
|
||||
static Color GenerateRandomColor();
|
||||
static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight);
|
||||
static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount);
|
||||
|
@ -31,7 +34,8 @@ static void DrawTextCenterKeyHelp(const char* key, const char* text, int posX, i
|
|||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main(void) {
|
||||
int main(void)
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
|
@ -51,11 +55,7 @@ int main(void) {
|
|||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
if(IsKeyPressed(KEY_SPACE))
|
||||
{
|
||||
ShuffleColorRectSequence(rectangles, rectCount);
|
||||
}
|
||||
if (IsKeyPressed(KEY_SPACE)) ShuffleColorRectSequence(rectangles, rectCount);
|
||||
|
||||
if (IsKeyPressed(KEY_UP))
|
||||
{
|
||||
|
@ -67,13 +67,15 @@ int main(void) {
|
|||
|
||||
if (IsKeyPressed(KEY_DOWN))
|
||||
{
|
||||
if(rectCount >= 4){
|
||||
if (rectCount >= 4)
|
||||
{
|
||||
rectCount--;
|
||||
rectSize = (float)screenWidth/rectCount;
|
||||
free(rectangles);
|
||||
rectangles = GenerateRandomColorRectSequence((float)rectCount, rectSize, (float)screenWidth, 0.75f*screenHeight);
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -82,9 +84,9 @@ int main(void) {
|
|||
ClearBackground(RAYWHITE);
|
||||
|
||||
int fontSize = 20;
|
||||
for(int x=0;x<rectCount;x++)
|
||||
for (int i = 0; i < rectCount; i++)
|
||||
{
|
||||
DrawRectangleRec(rectangles[x].r, rectangles[x].c);
|
||||
DrawRectangleRec(rectangles[i].r, rectangles[i].c);
|
||||
DrawTextCenterKeyHelp("SPACE", "to shuffle the sequence.", 10, screenHeight - 96, fontSize, BLACK);
|
||||
DrawTextCenterKeyHelp("UP", "to add a rectangle and generate a new sequence.", 10, screenHeight - 64, fontSize, BLACK);
|
||||
DrawTextCenterKeyHelp("DOWN", "to remove a rectangle and generate a new sequence.", 10, screenHeight - 32, fontSize, BLACK);
|
||||
|
@ -102,7 +104,6 @@ int main(void) {
|
|||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
free(rectangles);
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
@ -110,42 +111,51 @@ int main(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module functions definition
|
||||
//------------------------------------------------------------------------------------
|
||||
static Color GenerateRandomColor()
|
||||
{
|
||||
return CLITERAL(Color){
|
||||
Color color = {
|
||||
GetRandomValue(0, 255),
|
||||
GetRandomValue(0, 255),
|
||||
GetRandomValue(0, 255),
|
||||
255,
|
||||
255
|
||||
};
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
static ColorRect* GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight){
|
||||
int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount-1);
|
||||
static ColorRect *GenerateRandomColorRectSequence(float rectCount, float rectWidth, float screenWidth, float screenHeight)
|
||||
{
|
||||
ColorRect *rectangles = (ColorRect *)malloc((int)rectCount*sizeof(ColorRect));
|
||||
|
||||
int *seq = LoadRandomSequence((unsigned int)rectCount, 0, (unsigned int)rectCount - 1);
|
||||
float rectSeqWidth = rectCount*rectWidth;
|
||||
float startX = (screenWidth - rectSeqWidth)*0.5f;
|
||||
|
||||
for(int x=0;x<rectCount;x++){
|
||||
int rectHeight = (int)Remap((float)seq[x], 0, rectCount-1, 0, screenHeight);
|
||||
rectangles[x].c = GenerateRandomColor();
|
||||
rectangles[x].r = CLITERAL(Rectangle){
|
||||
startX + x * rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight
|
||||
};
|
||||
for (int i = 0; i < rectCount; i++)
|
||||
{
|
||||
int rectHeight = (int)Remap((float)seq[i], 0, rectCount - 1, 0, screenHeight);
|
||||
|
||||
rectangles[i].c = GenerateRandomColor();
|
||||
rectangles[i].r = CLITERAL(Rectangle){ startX + i*rectWidth, screenHeight - rectHeight, rectWidth, (float)rectHeight };
|
||||
}
|
||||
|
||||
UnloadRandomSequence(seq);
|
||||
|
||||
return rectangles;
|
||||
}
|
||||
|
||||
static void ShuffleColorRectSequence(ColorRect *rectangles, int rectCount)
|
||||
{
|
||||
int *seq = LoadRandomSequence(rectCount, 0, rectCount - 1);
|
||||
for(int i1=0;i1<rectCount;i1++){
|
||||
|
||||
for (int i1 = 0; i1 < rectCount; i1++)
|
||||
{
|
||||
ColorRect *r1 = &rectangles[i1];
|
||||
ColorRect *r2 = &rectangles[seq[i1]];
|
||||
|
||||
// swap only the color and height
|
||||
// Swap only the color and height
|
||||
ColorRect tmp = *r1;
|
||||
r1->c = r2->c;
|
||||
r1->r.height = r2->r.height;
|
||||
|
@ -153,8 +163,8 @@ static void ShuffleColorRectSequence(ColorRect* rectangles, int rectCount)
|
|||
r2->c = tmp.c;
|
||||
r2->r.height = tmp.r.height;
|
||||
r2->r.y = tmp.r.y;
|
||||
|
||||
}
|
||||
|
||||
UnloadRandomSequence(seq);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,87 @@
|
|||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [shapes] example - Rectangle advanced
|
||||
*
|
||||
* Example originally created with raylib 5.5, last time updated with raylib 5.5
|
||||
*
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
* Copyright (c) 2024-2025 raylib contributors and Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include "rlgl.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness
|
||||
// Adapted from both `DrawRectangleRounded` and `DrawRectangleGradientH`
|
||||
void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right)
|
||||
static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main(void)
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rectangle avanced");
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update rectangle bounds
|
||||
//----------------------------------------------------------------------------------
|
||||
float width = GetScreenWidth()/2.0f, height = GetScreenHeight()/6.0f;
|
||||
Rectangle rec = {
|
||||
GetScreenWidth() / 2.0f - width/2,
|
||||
GetScreenHeight() / 2.0f - 5*(height/2),
|
||||
width, height
|
||||
};
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
// Draw All Rectangles with different roundess for each side and different gradients
|
||||
DrawRectangleRoundedGradientH(rec, 0.8f, 0.8f, 36, BLUE, RED);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 0.5f, 1.0f, 36, RED, PINK);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 1.0f, 0.5f, 36, RED, BLUE);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 0.0f, 1.0f, 36, BLUE, BLACK);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 1.0f, 0.0f, 36, BLUE, PINK);
|
||||
EndDrawing();
|
||||
//--------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Draw rectangle with rounded edges and horizontal gradient, with options to choose side of roundness
|
||||
// NOTE: Adapted from both 'DrawRectangleRounded()' and 'DrawRectangleGradientH()' raylib [rshapes] implementations
|
||||
static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float roundnessRight, int segments, Color left, Color right)
|
||||
{
|
||||
// Neither side is rounded
|
||||
if ((roundnessLeft <= 0.0f && roundnessRight <= 0.0f) || (rec.width < 1) || (rec.height < 1 ))
|
||||
|
@ -29,7 +106,7 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou
|
|||
float stepLength = 90.0f/(float)segments;
|
||||
|
||||
/*
|
||||
Diagram Copied here for reference, original at `DrawRectangleRounded` source code
|
||||
Diagram Copied here for reference, original at 'DrawRectangleRounded()' source code
|
||||
|
||||
P0____________________P1
|
||||
/| |\
|
||||
|
@ -113,12 +190,9 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Here we use the `Diagram` to guide ourselves to which point receives what color.
|
||||
//
|
||||
// Here we use the 'Diagram' to guide ourselves to which point receives what color
|
||||
// By choosing the color correctly associated with a pointe the gradient effect
|
||||
// will naturally come from OpenGL interpolation.
|
||||
//
|
||||
// will naturally come from OpenGL interpolation
|
||||
|
||||
// [2] Upper Rectangle
|
||||
rlColor4ub(left.r, left.g, left.b, left.a);
|
||||
|
@ -187,27 +261,25 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou
|
|||
rlSetTexture(0);
|
||||
#else
|
||||
|
||||
//
|
||||
// Here we use the `Diagram` to guide ourselves to which point receives what color.
|
||||
//
|
||||
// Here we use the 'Diagram' to guide ourselves to which point receives what color.
|
||||
// By choosing the color correctly associated with a pointe the gradient effect
|
||||
// will naturally come from OpenGL interpolation.
|
||||
// But this time instead of Quad, we think in triangles.
|
||||
//
|
||||
|
||||
rlBegin(RL_TRIANGLES);
|
||||
|
||||
// Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
|
||||
for (int k = 0; k < 4; ++k)
|
||||
{
|
||||
Color color;
|
||||
float radius;
|
||||
Color color = { 0 };
|
||||
float radius = 0.0f;
|
||||
if (k == 0) color = left, radius = radiusLeft; // [1] Upper Left Corner
|
||||
if (k == 1) color = right, radius = radiusRight; // [3] Upper Right Corner
|
||||
if (k == 2) color = right, radius = radiusRight; // [5] Lower Right Corner
|
||||
if (k == 3) color = left, radius = radiusLeft; // [7] Lower Left Corner
|
||||
|
||||
float angle = angles[k];
|
||||
const Vector2 center = centers[k];
|
||||
|
||||
for (int i = 0; i < segments; i++)
|
||||
{
|
||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||
|
@ -274,57 +346,3 @@ void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, float rou
|
|||
rlEnd();
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - rectangle avanced");
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update rectangle bounds
|
||||
//----------------------------------------------------------------------------------
|
||||
float width = GetScreenWidth()/2.0f, height = GetScreenHeight()/6.0f;
|
||||
Rectangle rec = {
|
||||
GetScreenWidth() / 2.0f - width/2,
|
||||
GetScreenHeight() / 2.0f - (5)*(height/2),
|
||||
width, height
|
||||
};
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
// Draw All Rectangles with different roundess for each side and different gradients
|
||||
DrawRectangleRoundedGradientH(rec, 0.8f, 0.8f, 36, BLUE, RED);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 0.5f, 1.0f, 36, RED, PINK);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 1.0f, 0.5f, 36, RED, BLUE);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 0.0f, 1.0f, 36, BLUE, BLACK);
|
||||
|
||||
rec.y += rec.height + 1;
|
||||
DrawRectangleRoundedGradientH(rec, 1.0f, 0.0f, 36, BLUE, PINK);
|
||||
EndDrawing();
|
||||
//--------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -221,17 +221,19 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||
# -O2 # optimization level 2, if used, also set --memory-init-file 0
|
||||
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
|
||||
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
|
||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
|
||||
# -sUSE_PTHREADS=1 # multithreading support
|
||||
# -sWASM=0 # disable Web Assembly, emitted by default
|
||||
# -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
|
||||
# -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
|
||||
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||
# -sMINIFY_HTML=0 # minify generated html from shell.html
|
||||
# --profiling # include information for code profiling
|
||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||
# --preload-file resources # specify a resources folder for data compilation
|
||||
CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
||||
# --source-map-base # allow debugging in browser with source map
|
||||
# --shell-file shell.html # define a custom shell .html and output extension
|
||||
CFLAGS += -Os -sUSE_GLFW=3 -sTOTAL_MEMORY=16777216 --preload-file resources -sMINIFY_HTML=0
|
||||
ifeq ($(BUILD_MODE), DEBUG)
|
||||
CFLAGS += -sASSERTIONS=1 --profiling
|
||||
endif
|
||||
|
|
|
@ -227,17 +227,19 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||
# -O2 # optimization level 2, if used, also set --memory-init-file 0
|
||||
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
|
||||
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
|
||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
|
||||
# -sUSE_PTHREADS=1 # multithreading support
|
||||
# -sWASM=0 # disable Web Assembly, emitted by default
|
||||
# -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
|
||||
# -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
|
||||
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||
# -sMINIFY_HTML=0 # minify generated html from shell.html
|
||||
# --profiling # include information for code profiling
|
||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||
# --preload-file resources # specify a resources folder for data compilation
|
||||
CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
||||
# --source-map-base # allow debugging in browser with source map
|
||||
# --shell-file shell.html # define a custom shell .html and output extension
|
||||
CFLAGS += -Os -sUSE_GLFW=3 -sTOTAL_MEMORY=16777216 --preload-file resources -sMINIFY_HTML=0
|
||||
ifeq ($(BUILD_MODE), DEBUG)
|
||||
CFLAGS += -sASSERTIONS=1 --profiling
|
||||
endif
|
||||
|
|
11
src/Makefile
11
src/Makefile
|
@ -369,20 +369,23 @@ endif
|
|||
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
|
||||
# -Os # size optimization
|
||||
# -O2 # optimization level 2, if used, also set --memory-init-file 0
|
||||
# -sUSE_GLFW=3 # Use glfw3 library (context/input management) -> Only for linker!
|
||||
# -sUSE_GLFW=3 # Use glfw3 library (context/input management)
|
||||
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
|
||||
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB)
|
||||
# -sUSE_PTHREADS=1 # multithreading support
|
||||
# -sWASM=0 # disable Web Assembly, emitted by default
|
||||
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
|
||||
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||
# -sGL_ENABLE_GET_PROC_ADDRESS # enable using the *glGetProcAddress() family of functions, required for extensions loading
|
||||
# -sMINIFY_HTML=0 # minify generated html from shell.html
|
||||
# --profiling # include information for code profiling
|
||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||
# --preload-file resources # specify a resources folder for data compilation
|
||||
# --source-map-base # allow debugging in browser with source map
|
||||
# --shell-file shell.html # define a custom shell .html and output extension
|
||||
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
|
||||
CFLAGS += -sASSERTIONS=1 --profiling
|
||||
endif
|
||||
#CFLAGS += -sGL_ENABLE_GET_PROC_ADDRESS
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||
# Compiler flags for arquitecture
|
||||
|
|
|
@ -34,11 +34,7 @@
|
|||
<link rel="shortcut icon" href="https://www.raylib.com/favicon.ico">
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
}
|
||||
body { margin: 0px; overflow: hidden; background-color: black; }
|
||||
canvas.emscripten { border: 0px none; background-color: black; }
|
||||
</style>
|
||||
<script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script>
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="raylib web game">
|
||||
<meta property="og:image:type" content="image/png">
|
||||
<meta property="og:image:alt" content="New raylib web videogame, developed using raylib videogames library" />
|
||||
<meta property="og:image" content="https://www.raylib.com/common/raylib_logo.png">
|
||||
<meta property="og:image:alt" content="New raylib web videogame, developed using raylib videogames library" />
|
||||
<meta property="og:site_name" content="raylib - example">
|
||||
<meta property="og:url" content="https://www.raylib.com/games.html">
|
||||
<meta property="og:description" content="New raylib web videogame, developed using raylib videogames library">
|
||||
|
@ -34,11 +34,7 @@
|
|||
<link rel="shortcut icon" href="https://www.raylib.com/favicon.ico">
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: arial;
|
||||
margin: 0;
|
||||
padding: none;
|
||||
}
|
||||
body { font-family: arial; margin: 0; padding: none; }
|
||||
|
||||
#header {
|
||||
width: 100%;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue