From 76e968f6b7b211ed056f5ffe97d13086f58a661a Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 12 Mar 2019 11:54:45 +0100 Subject: Updated audio library: mini_al -> miniaudio --- projects/VS2015/raylib/raylib.vcxproj | 2 +- projects/VS2017/raylib/raylib.vcxproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'projects') diff --git a/projects/VS2015/raylib/raylib.vcxproj b/projects/VS2015/raylib/raylib.vcxproj index 2c63f382..6722ed07 100644 --- a/projects/VS2015/raylib/raylib.vcxproj +++ b/projects/VS2015/raylib/raylib.vcxproj @@ -246,7 +246,7 @@ - + diff --git a/projects/VS2017/raylib/raylib.vcxproj b/projects/VS2017/raylib/raylib.vcxproj index 8db1e511..4c620053 100644 --- a/projects/VS2017/raylib/raylib.vcxproj +++ b/projects/VS2017/raylib/raylib.vcxproj @@ -173,7 +173,7 @@ - + -- cgit v1.2.3 From 1203b7ad8f88e8241460ab5d09d37c8bbe4b1008 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 20 Mar 2019 10:58:06 +0100 Subject: Add Geany autocomplete tags --- projects/Geany/raylib.c.tags | 380 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 380 insertions(+) create mode 100644 projects/Geany/raylib.c.tags (limited to 'projects') diff --git a/projects/Geany/raylib.c.tags b/projects/Geany/raylib.c.tags new file mode 100644 index 00000000..b6ba63dd --- /dev/null +++ b/projects/Geany/raylib.c.tags @@ -0,0 +1,380 @@ +# format=pipe +RaylibIsAwesome|SuperStefkaGeanyTags|OpenSourceHaveFun| +InitWindow|void|(int width, int height, const char *title);| +CloseWindow|void|(void);| +IsWindowReady|bool|(void);| +WindowShouldClose|bool|(void);| +IsWindowMinimized|bool(void);| +ToggleFullscreen|void|(void);| +SetWindowIcon|void|(Image image);| +SetWindowTitle|void|(const char *title);| +SetWindowPosition|void|(int x, int y);| +SetWindowMonitor|void|(int monitor);| +SetWindowMinSize|void|(int width, int height);| +SetWindowSize|void|(int width, int height);| +GetScreenWidth|int|(void);| +GetScreenHeight|int|(void);| +ShowCursor|void|(void);| +HideCursor|void|(void);| +IsCursorHidden|bool|(void);| +EnableCursor|void|(void); +DisableCursor|void|(void);| +ClearBackground|void|(Color color);| +BeginDrawing|void|(void);| +EndDrawing|void|(void);| +BeginMode2D|void|(Camera2D camera);| +EndMode2D|void|(void); +BeginMode3D|void|(Camera3D camera);| +EndMode3D|void|(void);| +BeginTextureMode|void|(RenderTexture2D target);| +EndTextureMode|void|(void);| +GetMouseRay|Ray|(Vector2 mousePosition, Camera camera);| +GetWorldToScreen|Vector2|(Vector3 position, Camera camera);| +GetCameraMatrix|Matrix|(Camera camera);| +SetTargetFPS|void|(int fps);| +GetFPS|int|(void);| +GetFrameTime|float|(void);| +GetTime|double|(void);| +ColorToInt|int|(Color color);| +ColorNormalize|Vector4|(Color color);| +ColorToHSV|Vector3|(Color color);| +GetColor|Color|(int hexValue);| +Fade|Color|(Color color, float alpha);| +ShowLogo|void|(void);| +SetConfigFlags|void|(unsigned char flags);| +SetTraceLog|void|(unsigned char types);| +TraceLog|void|(int logType, const char *text, ...);| +TakeScreenshot|void|(const char *fileName);| +GetRandomValue|int|(int min, int max);| +IsFileExtension|bool|(const char *fileName, const char *ext);| +GetExtension|const char *|(const char *fileName);| +GetFileName|const char *|(const char *filePath);| +GetDirectoryPath|const char *|(const char *fileName);| +GetWorkingDirectory|const char *|(void);| +ChangeDirectory|bool|(const char *dir);| +IsFileDropped|bool|(void);| +GetDroppedFiles|char **|(int *count);| +ClearDroppedFiles|void|(void);| +StorageSaveValue|void|(int position, int value);| +StorageLoadValue|int|(int position);| +IsKeyPressed|bool|(int key);| +IsKeyDown|bool|(int key);| +IsKeyReleased|bool|(int key);| +IsKeyUp|bool|(int key);| +GetKeyPressed|int|(void);| +SetExitKey|void|(int key);| +IsGamepadAvailable|bool|(int gamepad);| +IsGamepadName|bool|(int gamepad, const char *name);| +GetGamepadName|const char *|(int gamepad);| +IsGamepadButtonPressed|bool|(int gamepad, int button);| +IsGamepadButtonDown|bool|(int gamepad, int button);| +IsGamepadButtonReleased|bool|(int gamepad, int button);| +IsGamepadButtonUp|bool|(int gamepad, int button);| +GetGamepadButtonPressed|int|(void);| +GetGamepadAxisCount|int|(int gamepad);| +GetGamepadAxisMovement|float|(int gamepad, int axis);| +IsMouseButtonPressed|bool|(int button);| +IsMouseButtonDown|bool|(int button);| +IsMouseButtonReleased|bool|(int button);| +IsMouseButtonUp|bool|(int button);| +GetMouseX|int|(void);| +GetMouseY|int|(void);| +GetMousePosition|Vector2|(void);| +SetMousePosition|void|(Vector2 position);| +GetMouseWheelMove|int|(void);| +GetTouchX|int|(void);| +GetTouchY|int|(void);| +GetTouchPosition|Vector2|(int index);| +SetGesturesEnabled|void|(unsigned int gestureFlags);| +IsGestureDetected|bool|(int gesture);| +GetGestureDetected|int|(void);| +GetTouchPointsCount|int|(void);| +GetGestureHoldDuration|float|(void);| +GetGestureDragVector|Vector2|(void);| +GetGestureDragAngle|float|(void);| +GetGesturePinchVector|Vector2|(void);| +GetGesturePinchAngle|float|(void);| +SetCameraMode|void|(Camera camera, int mode);| +UpdateCamera|void|(Camera *camera);| +SetCameraPanControl|void|(int panKey);| +SetCameraAltControl|void|(int altKey);| +SetCameraSmoothZoomControl|void|(int szKey);| +SetCameraMoveControls|void|(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);| +DrawPixel|void|(int posX, int posY, Color color);| +DrawPixelV|void|(Vector2 position, Color color); +DrawLine|void|(int startPosX, int startPosY, int endPosX, int endPosY, Color color); +DrawLineV|void|(Vector2 startPos, Vector2 endPos, Color color);| +DrawLineEx|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);| +DrawLineBezier|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);| +DrawCircle|void|(int centerX, int centerY, float radius, Color color);| +DrawCircleGradient|void|(int centerX, int centerY, float radius, Color color1, Color color2);| +DrawCircleV|void|(Vector2 center, float radius, Color color);| +DrawCircleLines|void|(int centerX, int centerY, float radius, Color color);| +DrawRectangle|void|(int posX, int posY, int width, int height, Color color);| +DrawRectangleV|void|(Vector2 position, Vector2 size, Color color);| +DrawRectangleRec|void|(Rectangle rec, Color color);| +DrawRectanglePro|void|(Rectangle rec, Vector2 origin, float rotation, Color color);| +DrawRectangleGradientV|void|(int posX, int posY, int width, int height, Color color1, Color color2);| +DrawRectangleGradientH|void|(int posX, int posY, int width, int height, Color color1, Color color2);| +DrawRectangleGradientEx|void|(Rectangle rec, Color col1, Color col2, Color col3, Color col4);| +DrawRectangleLines|void|(int posX, int posY, int width, int height, Color color);| +DrawRectangleLinesEx|void|(Rectangle rec, int lineThick, Color color);| +DrawTriangle|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);| +DrawTriangleLines|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);| +DrawPoly|void|(Vector2 center, int sides, float radius, float rotation, Color color);| +DrawPolyEx|void|(Vector2 *points, int numPoints, Color color);| +DrawPolyExLines|void|(Vector2 *points, int numPoints, Color color);| +CheckCollisionRecs|bool|(Rectangle rec1, Rectangle rec2);| +CheckCollisionCircles|bool|(Vector2 center1, float radius1, Vector2 center2, float radius2);| +CheckCollisionCircleRec|bool|(Vector2 center, float radius, Rectangle rec);| +GetCollisionRec|Rectangle|(Rectangle rec1, Rectangle rec2);| +CheckCollisionPointRec|bool|(Vector2 point, Rectangle rec);| +CheckCollisionPointCircle|bool|(Vector2 point, Vector2 center, float radius);| +CheckCollisionPointTriangle|bool|(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);| +LoadImage|Image|(const char *fileName);| +LoadImageEx|Image|(Color *pixels, int width, int height);| +LoadImagePro|Image|(void *data, int width, int height, int format);| +LoadImageRaw|Image|(const char *fileName, int width, int height, int format, int headerSize);| +ExportImage|void|(const char *fileName, Image image);| +LoadTexture|Texture2D|(const char *fileName);| +LoadTextureFromImage|Texture2D|(Image image);| +RenderTexture2D LoadRenderTexture(int width, int height);| +UnloadImage|void|(Image image);| +UnloadTexture|void|(Texture2D texture);| +UnloadRenderTexture|void|(RenderTexture2D target);| +GetImageData|Color *|(Image image);| +GetImageDataNormalized|Vector4 *|(Image image);| +GetPixelDataSize|int|(int width, int height, int format);| +GetTextureData|Image|(Texture2D texture);| +UpdateTexture|void|(Texture2D texture, const void *pixels);| +ImageCopy|Image|(Image image);| +ImageToPOT|void|(Image *image, Color fillColor);| +ImageFormat|void|(Image *image, int newFormat);| +ImageAlphaMask|void|(Image *image, Image alphaMask);| +ImageAlphaClear|void|(Image *image, Color color, float threshold);| +ImageAlphaCrop|void|(Image *image, float threshold);| +ImageAlphaPremultiply|void|(Image *image);| +ImageCrop|void|(Image *image, Rectangle crop);| +ImageResize|void|(Image *image, int newWidth, int newHeight);| +ImageResizeNN|void|(Image *image, int newWidth,int newHeight);| +ImageResizeCanvas|void|(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color);| +ImageMipmaps|void|(Image *image);| +ImageDither|void|(Image *image, int rBpp, int gBpp, int bBpp, int aBpp);| +ImageText|Image|(const char *text, int fontSize, Color color);| +ImageTextEx|Image|(Font font, const char *text, float fontSize, float spacing, Color tint);| +ImageDraw|void|(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);| +ImageDrawRectangle|void|(Image *dst, Vector2 position, Rectangle rec, Color color);| +ImageDrawText|void|(Image *dst, Vector2 position, const char *text, int fontSize, Color color);| +ImageDrawTextEx|void|(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color);| +ImageFlipVertical|void|(Image *image);| +ImageFlipHorizontal|void|(Image *image);| +ImageRotateCW|void|(Image *image);| +ImageRotateCCW|void|(Image *image);| +ImageColorTint|void|(Image *image, Color color);| +ImageColorInvert|void|(Image *image);| +ImageColorGrayscale|void|(Image *image);| +ImageColorContrast|void|(Image *image, float contrast);| +ImageColorBrightness|void|(Image *image, int brightness);| +ImageColorReplace|void|(Image *image, Color color, Color replace);| +GenImageColor|void|(int width, int height, Color color);| +GenImageGradientV|void|(int width, int height, Color top, Color bottom);| +GenImageGradientH|void|(int width, int height, Color left, Color right);| +GenImageGradientRadial|void|(int width, int height, float density, Color inner, Color outer);| +GenImageChecked|void|(int width, int height, int checksX, int checksY, Color col1, Color col2);| +GenImageWhiteNoise|void|(int width, int height, float factor);| +GenImagePerlinNoise|void|(int width, int height, int offsetX, int offsetY, float scale);| +GenImageCellular|void|(int width, int height, int tileSize);| +GenTextureMipmaps|void|(Texture2D *texture);| +SetTextureFilter|void|(Texture2D texture, int filterMode);| +SetTextureWrap|void|(Texture2D texture, int wrapMode);| +DrawTexture|void|(Texture2D texture, int posX, int posY, Color tint);| +DrawTextureV|void|(Texture2D texture, Vector2 position, Color tint);| +DrawTextureEx|void|(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);| +DrawTextureRec|void|(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint);| +DrawTexturePro|void|(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);| +GetFontDefault|Font|(void);| +LoadFont|Font|(const char *fileName);| +LoadFontEx|Font|(const char *fileName, int fontSize, int charsCount, int *fontChars);| +LoadFontData|CharInfo *|(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf);| +GenImageFontAtlas|Image|(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod);| +UnloadFont|void|(Font font);| +DrawFPS|void|(int posX, int posY);| +DrawText|void|(const char *text, int posX, int posY, int fontSize, Color color);| +DrawTextEx|void|(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint);| +MeasureText|int|(const char *text, int fontSize);| +MeasureTextEx|Vector2|(Font font, const char *text, float fontSize, float spacing);| +FormatText|const char *|(const char *text, ...);| +SubText|const char *|(const char *text, int position, int length);| +GetGlyphIndex|int|(Font font, int character);| +DrawLine3D|void|(Vector3 startPos, Vector3 endPos, Color color);| +DrawCircle3D|void|(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);| +DrawCube|void|(Vector3 position, float width, float height, float length, Color color);| +DrawCubeV|void|(Vector3 position, Vector3 size, Color color);| +DrawCubeWires|void|(Vector3 position, float width, float height, float length, Color color);| +DrawCubeTexture|void|(Texture2D texture, Vector3 position, float width, float height, float length, Color color);| +DrawSphere|void|(Vector3 centerPos, float radius, Color color);| +DrawSphereEx|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);| +DrawSphereWires|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);| +DrawCylinder|void|(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);| +DrawCylinderWires|void|(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);| +DrawPlane|void|(Vector3 centerPos, Vector2 size, Color color);| +DrawRay|void|(Ray ray, Color color);| +DrawGrid|void|(int slices, float spacing);| +DrawGizmo|void|(Vector3 position);| +LoadModel|Model|(const char *fileName);| +LoadModelFromMesh|Model|(Mesh mesh);| +UnloadModel|void|(Model model);| +LoadMesh|Mesh|(const char *fileName);| +UnloadMesh|void|(Mesh *mesh);| +ExportMesh|void|(const char *fileName, Mesh mesh);| +MeshBoundingBox|BoundingBox|(Mesh mesh);| +MeshTangents|void|(Mesh *mesh);| +MeshBinormals|void|(Mesh *mesh);| +GenMeshPlane|Mesh|(float width, float length, int resX, int resZ);| +GenMeshCube|Mesh|(float width, float height, float length);| +GenMeshSphere|Mesh|(float radius, int rings, int slices);| +GenMeshHemiSphere|Mesh|(float radius, int rings, int slices);| +GenMeshCylinder|Mesh|(float radius, float height, int slices);| +GenMeshTorus|Mesh|(float radius, float size, int radSeg, int sides);| +GenMeshKnot|Mesh|(float radius, float size, int radSeg, int sides);| +GenMeshHeightmap|Mesh|(Image heightmap, Vector3 size);| +GenMeshCubicmap|Mesh|(Image cubicmap, Vector3 cubeSize);| +LoadMaterial|Material|(const char *fileName);| +LoadMaterialDefault|Material|(void);| +UnloadMaterial|void|(Material material);| +DrawModel|void|(Model model, Vector3 position, float scale, Color tint);| +DrawModelEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);| +DrawModelWires|void|(Model model, Vector3 position, float scale, Color tint);| +DrawModelWiresEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);| +DrawBoundingBox|void|(BoundingBox box, Color color);| +DrawBillboard|void|(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);| +DrawBillboardRec|void|(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);| +CheckCollisionSpheres|bool|(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);| +CheckCollisionBoxes|bool|(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2);| +CheckCollisionBoxSphere|bool|(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere);| +CheckCollisionRaySphere|bool|(Ray ray, Vector3 spherePosition, float sphereRadius);| +CheckCollisionRaySphereEx|bool|(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);| +CheckCollisionRayBox|bool|(Ray ray, Vector3 minBBox, Vector3 maxBBox);| +GetCollisionRayModel|RayHitInfo|(Ray ray, Model *model);| +GetCollisionRayTriangle|RayHitInfo|(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);| +GetCollisionRayGround|RayHitInfo|(Ray ray, float groundHeight);| +LoadText|char *|(const char *fileName);| +LoadShader|Shader|(char *vsFileName, char *fsFileName);| +LoadShaderCode|Shader|(char *vsCode, char *fsCode);| +UnloadShader|void|(Shader shader);| +GetShaderDefault|Shader|(void);| +GetTextureDefault|Texture2D|(void);| +GetShaderLocation|int|(Shader shader, const char *uniformName);| +SetShaderValue|void|(Shader shader, int uniformLoc, float *value, int size);| +SetShaderValuei|void|(Shader shader, int uniformLoc, int *value, int size);| +SetShaderValueMatrix|void|(Shader shader, int uniformLoc, Matrix mat);| +SetMatrixProjection|void|(Matrix proj);| +SetMatrixModelview|void|(Matrix view);| +GetMatrixModelview|Matrix|();| +BeginShaderMode|void|(Shader shader);| +EndShaderMode|void|(void);| +BeginBlendMode|void|(int mode);| +EndBlendMode|void|(void);| +GetVrDeviceInfo|VrDeviceInfo|(int vrDeviceType);| +InitVrSimulator|void|(VrDeviceInfo info);| +CloseVrSimulator|void|(void);| +IsVrSimulatorReady|bool|(void);| +UpdateVrTracking|void|(Camera *camera);| +ToggleVrMode|void|(void);| +BeginVrDrawing|void|(void);| +EndVrDrawing|void|(void);| +InitAudioDevice|void|(void);| +CloseAudioDevice|void|(void);| +IsAudioDeviceReady|bool|(void);| +SetMasterVolume|void|(float volume);| +LoadWave|Wave|(const char *fileName);| +LoadWaveEx|Wave|(float *data, int sampleCount, int sampleRate, int sampleSize, int channels);| +LoadSound|Sound|(const char *fileName);| +LoadSoundFromWave|Sound|(Wave wave);| +UpdateSound|void|(Sound sound, void *data, int numSamples);| +UnloadWave|void|(Wave wave);| +UnloadSound|void|(Sound sound);| +PlaySound|void|(Sound sound);| +PauseSound|void|(Sound sound);| +ResumeSound|void|(Sound sound);| +StopSound|void|(Sound sound);| +IsSoundPlaying|bool|(Sound sound);| +SetSoundVolume|void|(Sound sound, float volume);| +SetSoundPitch|void|(Sound sound, float pitch);| +WaveFormat|void|(Wave *wave, int sampleRate, int sampleSize, int channels);| +WaveCopy|Wave|(Wave wave);| +WaveCrop|void|(Wave *wave, int initSample, int finalSample);| +GetWaveData|float *|(Wave wave);| +LoadMusicStream|Music|(const char *fileName);| +UnloadMusicStream|void|(Music music);| +PlayMusicStream|void|(Music music);| +UpdateMusicStream|void|(Music music);| +StopMusicStream|void|(Music music);| +PauseMusicStream|void|(Music music);| +ResumeMusicStream|void|(Music music);| +IsMusicPlaying|bool|(Music music);| +SetMusicVolume|void|(Music music, float volume);| +SetMusicPitch|void|(Music music, float pitch);| +SetMusicLoopCount|void|(Music music, float count);| +GetMusicTimeLength|float|(Music music);| +GetMusicTimePlayed|float|(Music music);| +InitAudioStream|AudioStream|(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels);| +UpdateAudioStream|void|(AudioStream stream, void *data, int numSamples);| +CloseAudioStream|void|(AudioStream stream);| +IsAudioBufferProcessed|bool|(AudioStream stream);| +PlayAudioStream|void|(AudioStream stream);| +PauseAudioStream|void|(AudioStream stream);| +ResumeAudioStream|void|(AudioStream stream);| +StopAudioStream|void|(AudioStream stream);| +Color|struct|| +Rectangle|struct|| +Vector2|struct|| +Vector3|struct|| +Vector4|struct|| +Quaternion|struct|| +Matrix|struct|| +Image|struct|| +Texture|struct|| +RenderTexture|struct|| +CharInfo|struct|| +Font|struct|| +Camera|struct|| +Camera2D|struct|| +Mesh|struct|| +Shader|struct|| +MaterialMap|struct|| +Material|struct|| +Model|struct|| +Ray|struct|| +RayHitInfo|struct|| +Wave|struct|| +Sound|struct|| +Music|struct|| +AudioStream|struct|| +LIGHTGRAY|#define|| +GRAY|#define|| +DARKGRAY|#define|| +YELLOW|#define|| +GOLD|#define|| +ORANGE|#define|| +PINK|#define|| +RED|#define|| +MAROON|#define|| +GREEN|#define|| +LIME|#define|| +DARKGREEN|#define|| +SKYBLUE|#define|| +BLUE|#define|| +DARKBLUE|#define|| +PURPLE|#define|| +VIOLET|#define|| +DARKPURPLE|#define|| +BEIGE|#define|| +BROWN|#define|| +DARKBROWN|#define|| +WHITE|#define|| +BLACK|#define|| +BLANK|#define|| +MAGENTA|#define|| +RAYWHITE|#define|| + -- cgit v1.2.3 From 0a492b5dead96619b705ccf2d173f2d92df01657 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 1 Apr 2019 12:09:00 +0200 Subject: Retarget VS2017 solution --- projects/VS2017/examples/core_basic_window.vcxproj | 2 +- projects/VS2017/examples/core_basic_window_cpp.vcxproj | 2 +- projects/VS2017/raylib/raylib.vcxproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'projects') diff --git a/projects/VS2017/examples/core_basic_window.vcxproj b/projects/VS2017/examples/core_basic_window.vcxproj index 48e06e44..87bef8d8 100644 --- a/projects/VS2017/examples/core_basic_window.vcxproj +++ b/projects/VS2017/examples/core_basic_window.vcxproj @@ -22,7 +22,7 @@ {0981CA98-E4A5-4DF1-987F-A41D09131EFC} Win32Proj core_basic_window - 10.0.14393.0 + 10.0.17763.0 core_basic_window diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index 39a2aee7..cfe08524 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -22,7 +22,7 @@ {B655E850-3322-42F7-941D-6AC18FD66CA1} Win32Proj raylib_example_cpp - 10.0.14393.0 + 10.0.17763.0 core_basic_window_cpp diff --git a/projects/VS2017/raylib/raylib.vcxproj b/projects/VS2017/raylib/raylib.vcxproj index 4c620053..3ff77104 100644 --- a/projects/VS2017/raylib/raylib.vcxproj +++ b/projects/VS2017/raylib/raylib.vcxproj @@ -22,7 +22,7 @@ {E89D61AC-55DE-4482-AFD4-DF7242EBC859} Win32Proj raylib - 10.0.14393.0 + 10.0.17763.0 -- cgit v1.2.3 From f21761fbbb02f0b58b5b54342f0c3ad3abc0003e Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sun, 7 Apr 2019 17:49:12 +0200 Subject: Happy new year 2019 --- projects/VSCode/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'projects') diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 747718fc..3cffaaba 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -2,7 +2,7 @@ # # raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 # -# Copyright (c) 2013-2018 Ramon Santamaria (@raysan5) +# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. In no event # will the authors be held liable for any damages arising from the use of this software. -- cgit v1.2.3 From 303c8868522126898830d09689ea20b2ead1553e Mon Sep 17 00:00:00 2001 From: Chris Dill Date: Wed, 24 Apr 2019 09:44:08 +0100 Subject: Added project for 4coder Using example from the VSCode project --- projects/4coder/Makefile | 344 +++++++++++++++++++++++++++++++++++++++ projects/4coder/Makefile.Android | 298 +++++++++++++++++++++++++++++++++ projects/4coder/game | Bin 0 -> 14480 bytes projects/4coder/main.c | 39 +++++ projects/4coder/project.4coder | 54 ++++++ 5 files changed, 735 insertions(+) create mode 100644 projects/4coder/Makefile create mode 100644 projects/4coder/Makefile.Android create mode 100644 projects/4coder/game create mode 100644 projects/4coder/main.c create mode 100644 projects/4coder/project.4coder (limited to 'projects') diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile new file mode 100644 index 00000000..3cffaaba --- /dev/null +++ b/projects/4coder/Makefile @@ -0,0 +1,344 @@ +#************************************************************************************************** +# +# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5 +# +# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5) +# +# This software is provided "as-is", without any express or implied warranty. In no event +# will the authors be held liable for any damages arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, including commercial +# applications, and to alter it and redistribute it freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not claim that you +# wrote the original software. If you use this software in a product, an acknowledgment +# in the product documentation would be appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be misrepresented +# as being the original software. +# +# 3. This notice may not be removed or altered from any source distribution. +# +#************************************************************************************************** + +.PHONY: all clean + +# Define required raylib variables +# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop() +PLATFORM ?= PLATFORM_DESKTOP +RAYLIB_PATH ?= ../.. +PROJECT_NAME ?= game +DEBUGGING ?= FALSE + +# Default path for raylib on Raspberry Pi, if installed in different path, update it! +ifeq ($(PLATFORM),PLATFORM_RPI) + RAYLIB_PATH ?= /home/pi/raylib +endif + +# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) +RAYLIB_LIBTYPE ?= STATIC + +# Use external GLFW library instead of rglfw module +USE_EXTERNAL_GLFW ?= FALSE + +# Use Wayland display server protocol on Linux desktop +# by default it uses X11 windowing system +USE_WAYLAND_DISPLAY ?= FALSE + +# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile) + + +# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + # No uname.exe on MinGW!, but OS=Windows_NT on Windows! + # ifeq ($(UNAME),Msys) -> Windows + ifeq ($(OS),Windows_NT) + PLATFORM_OS=WINDOWS + export PATH := C:/raylib/mingw32/bin:$(PATH) + else + UNAMEOS=$(shell uname) + ifeq ($(UNAMEOS),Linux) + PLATFORM_OS=LINUX + endif + ifeq ($(UNAMEOS),FreeBSD) + PLATFORM_OS=BSD + endif + ifeq ($(UNAMEOS),OpenBSD) + PLATFORM_OS=BSD + endif + ifeq ($(UNAMEOS),NetBSD) + PLATFORM_OS=BSD + endif + ifeq ($(UNAMEOS),DragonFly) + PLATFORM_OS=BSD + endif + ifeq ($(UNAMEOS),Darwin) + PLATFORM_OS=OSX + endif + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + UNAMEOS=$(shell uname) + ifeq ($(UNAMEOS),Linux) + PLATFORM_OS=LINUX + endif +endif + +ifeq ($(PLATFORM),PLATFORM_WEB) + # Emscripten required variables + EMSDK_PATH = C:/emsdk + EMSCRIPTEN_VERSION = 1.38.8 + CLANG_VERSION = e1.38.8_64bit + PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 + NODE_VERSION = 8.9.1_64bit + export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) + EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) +endif + +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs + +# Define raylib release directory for compiled library +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),WINDOWS) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32 + endif + ifeq ($(PLATFORM_OS),LINUX) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux + endif + ifeq ($(PLATFORM_OS),OSX) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx + endif + ifeq ($(PLATFORM_OS),BSD) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5 +endif + +# Define default C compiler: gcc +# NOTE: define g++ compiler if using C++ +CC = gcc + +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),OSX) + # OSX default compiler + CC = clang + endif + ifeq ($(PLATFORM_OS),BSD) + # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler + CC = clang + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + ifeq ($(USE_RPI_CROSS_COMPILER),TRUE) + # Define RPI cross-compiler + #CC = armv6j-hardfloat-linux-gnueabi-gcc + CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc + endif +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + # HTML5 emscripten compiler + CC = emcc +endif + +# Define default make program: Mingw32-make +MAKE = mingw32-make + +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),LINUX) + MAKE = make + endif + ifeq ($(PLATFORM_OS),OSX) + MAKE = make + endif +endif + +# Define compiler flags: +# -O1 defines optimization level +# -g enable debugging +# -s strip unnecessary data from build +# -Wall turns on most, but not all, compiler warnings +# -std=c99 defines C language mode (standard C from 1999 revision) +# -std=gnu99 defines C language mode (GNU C from 1999 revision) +# -Wno-missing-braces ignore invalid warning (GCC bug 53119) +# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec +ifeq ($(DEBUGGING), TRUE) + CFLAGS += -g +else + CFLAGS += -O1 -s +endif +CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces + +# Additional flags for compiler (if desired) +#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),WINDOWS) + # resources file contains windows exe icon + # -Wl,--subsystem,windows hides the console window + CFLAGS += -Wl,--subsystem,windows + LDFLAGS += $(RAYLIB_PATH)/raylib.rc.data + endif + ifeq ($(PLATFORM_OS),LINUX) + CFLAGS += -D_DEFAULT_SOURCE + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + CFLAGS += -std=gnu99 +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + # -O2 # if used, also set --memory-init-file 0 + # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) + # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing + # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) + # -s USE_PTHREADS=1 # multithreading support + # -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly) + # --preload-file resources # specify a resources folder for data compilation + CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources + + # Define a custom shell .html and output extension + CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + EXT = .html +endif + +# Define include paths for required headers +# NOTE: Several external required libraries (stb and others) +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external + +# Define additional directories containing required header files +ifeq ($(PLATFORM),PLATFORM_RPI) + # RPI requried libraries + INCLUDE_PATHS += -I/opt/vc/include + INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux + INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads +endif + +# Define library paths containing required libs +LDFLAGS += -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src + +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),BSD) + INCLUDE_PATHS += -I/usr/local/include + LDFLAGS += -L. -Lsrc -L/usr/local/lib + endif +endif + +ifeq ($(PLATFORM),PLATFORM_RPI) + LDFLAGS += -L/opt/vc/lib +endif + +# Define any libraries required on linking +# if you want to link libraries (libname.so or libname.a), use the -lname +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),WINDOWS) + # Libraries for Windows desktop compilation + LDLIBS = -lraylib -lopengl32 -lgdi32 + + # Required for physac examples + #LDLIBS += -static -lpthread + endif + ifeq ($(PLATFORM_OS),LINUX) + # Libraries for Debian GNU/Linux desktop compiling + # NOTE: Required packages: libegl1-mesa-dev + LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt + + # On X11 requires also below libraries + LDLIBS += -lX11 + # NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them + #LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor + + # On Wayland windowing system, additional libraries requires + ifeq ($(USE_WAYLAND_DISPLAY),TRUE) + LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon + endif + endif + ifeq ($(PLATFORM_OS),OSX) + # Libraries for OSX 10.9 desktop compiling + # NOTE: Required packages: libopenal-dev libegl1-mesa-dev + LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo + endif + ifeq ($(PLATFORM_OS),BSD) + # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling + # NOTE: Required packages: mesa-libs + LDLIBS = -lraylib -lGL -lpthread -lm + + # On XWindow requires also below libraries + LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor + endif + ifeq ($(USE_EXTERNAL_GLFW),TRUE) + # NOTE: It could require additional packages installed: libglfw3-dev + LDLIBS += -lglfw + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + # Libraries for Raspberry Pi compiling + # NOTE: Required packages: libasound2-dev (ALSA) + LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + # Libraries for web (HTML5) compiling + LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc +endif + +# Define a recursive wildcard function +rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) + +# Define all source files required +SRC_DIR = src +OBJ_DIR = obj + +# Define all object files from source files +SRC = $(call rwildcard, *.c, *.h) +#OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) +OBJS = main.c + +# For Android platform we call a custom Makefile.Android +ifeq ($(PLATFORM),PLATFORM_ANDROID) + MAKEFILE_PARAMS = -f Makefile.Android + export PROJECT_NAME + export SRC_DIR +else + MAKEFILE_PARAMS = $(PROJECT_NAME) +endif + +# Default target entry +# NOTE: We call this Makefile target or Makefile.Android target +all: + $(MAKE) $(MAKEFILE_PARAMS) + +# Project target defined by PROJECT_NAME +$(PROJECT_NAME): $(OBJS) + $(CC) -o $(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) + +# Compile source files +# NOTE: This pattern will compile every module defined on $(OBJS) +#%.o: %.c +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c + $(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) + +# Clean everything +clean: +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),WINDOWS) + del *.o *.exe /s + endif + ifeq ($(PLATFORM_OS),LINUX) + find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f + endif + ifeq ($(PLATFORM_OS),OSX) + find . -type f -perm +ugo+x -delete + rm -f *.o + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + find . -type f -executable -delete + rm -f *.o +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + del *.o *.html *.js +endif + @echo Cleaning done + diff --git a/projects/4coder/Makefile.Android b/projects/4coder/Makefile.Android new file mode 100644 index 00000000..b6c68417 --- /dev/null +++ b/projects/4coder/Makefile.Android @@ -0,0 +1,298 @@ +#************************************************************************************************** +# +# raylib makefile for Android project (APK building) +# +# Copyright (c) 2017 Ramon Santamaria (@raysan5) +# +# This software is provided "as-is", without any express or implied warranty. In no event +# will the authors be held liable for any damages arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, including commercial +# applications, and to alter it and redistribute it freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not claim that you +# wrote the original software. If you use this software in a product, an acknowledgment +# in the product documentation would be appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be misrepresented +# as being the original software. +# +# 3. This notice may not be removed or altered from any source distribution. +# +#************************************************************************************************** + +# Define required raylib variables +PLATFORM ?= PLATFORM_ANDROID +RAYLIB_PATH ?= ..\.. + +# Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version +ANDROID_ARCH ?= ARM +ANDROID_API_VERSION = 21 +ifeq ($(ANDROID_ARCH),ARM) + ANDROID_ARCH_NAME = armeabi-v7a +endif +ifeq ($(ANDROID_ARCH),ARM64) + ANDROID_ARCH_NAME = arm64-v8a +endif + +# Required path variables +# NOTE: JAVA_HOME must be set to JDK +JAVA_HOME ?= C:/JavaJDK +ANDROID_HOME = C:/android-sdk +ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) +ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 +ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools + +# Android project configuration variables +PROJECT_NAME ?= raylib_game +PROJECT_LIBRARY_NAME ?= main +PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_RESOURCES_PATH ?= resources +PROJECT_SOURCE_FILES ?= raylib_game.c + +# Some source files are placed in directories, when compiling to some +# output directory other than source, that directory must pre-exist. +# Here we get a list of required folders that need to be created on +# code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors. +PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES))) + +# Android app configuration variables +APP_LABEL_NAME ?= rGame +APP_COMPANY_NAME ?= raylib +APP_PRODUCT_NAME ?= rgame +APP_VERSION_CODE ?= 1 +APP_VERSION_NAME ?= 1.0 +APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png +APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png +APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png +APP_SCREEN_ORIENTATION ?= landscape +APP_KEYSTORE_PASS ?= raylib + +# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) +RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME) + +# Shared libs must be added to APK if required +# NOTE: Generated NativeLoader.java automatically load those libraries +ifeq ($(RAYLIB_LIBTYPE),SHARED) + PROJECT_SHARED_LIBS = lib/$(ANDROID_ARCH_NAME)/libraylib.so +endif + +# Compiler and archiver +# NOTE: GCC is being deprecated in Android NDK r16 +ifeq ($(ANDROID_ARCH),ARM) + CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang + AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar +endif +ifeq ($(ANDROID_ARCH),ARM64) + CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang + AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar +endif + +# Compiler flags for arquitecture +ifeq ($(ANDROID_ARCH),ARM) + CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 +endif +ifeq ($(ANDROID_ARCH),ARM64) + CFLAGS = -std=c99 -target aarch64 -mfix-cortex-a53-835769 +endif +# Compilation functions attributes options +CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC +# Compiler options for the linker +CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes +# Preprocessor macro definitions +CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) + +# Paths containing required header files +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue + +# Linker options +LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a +LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings +# Force linking of library module to define symbol +LDFLAGS += -u ANativeActivity_onCreate +# Library paths containing required libs +LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) -L$(ANDROID_TOOLCHAIN)\sysroot\usr\lib + +# Define any libraries to link into executable +# if you want to link libraries (libname.so or libname.a), use the -lname +LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl + +# Generate target objects list from PROJECT_SOURCE_FILES +OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES)) + +# Android APK building process... some steps required... +# NOTE: typing 'make' will invoke the default target entry called 'all', +all: create_temp_project_dirs \ + copy_project_required_libs \ + copy_project_resources \ + generate_loader_script \ + generate_android_manifest \ + generate_apk_keystore \ + config_project_package \ + compile_project_code \ + compile_project_class \ + compile_project_class_dex \ + create_project_apk_package \ + sign_project_apk_package \ + zipalign_project_apk_package + +# Create required temp directories for APK building +create_temp_project_dirs: + if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH) + if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj + if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src + if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com + if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) + if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) + if not exist $(PROJECT_BUILD_PATH)\lib mkdir $(PROJECT_BUILD_PATH)\lib + if not exist $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) mkdir $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) + if not exist $(PROJECT_BUILD_PATH)\bin mkdir $(PROJECT_BUILD_PATH)\bin + if not exist $(PROJECT_BUILD_PATH)\res mkdir $(PROJECT_BUILD_PATH)\res + if not exist $(PROJECT_BUILD_PATH)\res\drawable-ldpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-ldpi + if not exist $(PROJECT_BUILD_PATH)\res\drawable-mdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-mdpi + if not exist $(PROJECT_BUILD_PATH)\res\drawable-hdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-hdpi + if not exist $(PROJECT_BUILD_PATH)\res\values mkdir $(PROJECT_BUILD_PATH)\res\values + if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets + if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) + if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens + $(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir))) + +define create_dir + if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1) +endef + +# Copy required shared libs for integration into APK +# NOTE: If using shared libs they are loaded by generated NativeLoader.java +copy_project_required_libs: +ifeq ($(RAYLIB_LIBTYPE),SHARED) + copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so +endif +ifeq ($(RAYLIB_LIBTYPE),STATIC) + copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a +endif + +# Copy project required resources: strings.xml, icon.png, assets +# NOTE: Required strings.xml is generated and game resources are copied to assets folder +# TODO: Review xcopy usage, it can not be found in some systems! +copy_project_resources: + copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y + copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y + copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y + @echo ^ > $(PROJECT_BUILD_PATH)/res/values/strings.xml + @echo ^^$(APP_LABEL_NAME)^^ >> $(PROJECT_BUILD_PATH)/res/values/strings.xml + if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F + +# Generate NativeLoader.java to load required shared libraries +# NOTE: Probably not the bet way to generate this file... but it works. +generate_loader_script: + @echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo static { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java +ifeq ($(RAYLIB_LIBTYPE),SHARED) + @echo System.loadLibrary("raylib"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java +endif + @echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + @echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + +# Generate AndroidManifest.xml with all the required options +# NOTE: Probably not the bet way to generate this file... but it works. +generate_android_manifest: + @echo ^ > $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo android:versionCode="$(APP_VERSION_CODE)" android:versionName="$(APP_VERSION_NAME)" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo android:configChanges="orientation|keyboardHidden|screenSize" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo android:screenOrientation="$(APP_SCREEN_ORIENTATION)" android:launchMode="singleTask" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo android:clearTaskOnLaunch="true"^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + @echo ^ >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml + +# Generate storekey for APK signing: $(PROJECT_NAME).keystore +# NOTE: Configure here your Distinguished Names (-dname) if required! +generate_apk_keystore: + if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA + +# Config project package and resource using AndroidManifest.xml and res/values/strings.xml +# NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java +config_project_package: + $(ANDROID_BUILD_TOOLS)/aapt package -f -m -S $(PROJECT_BUILD_PATH)/res -J $(PROJECT_BUILD_PATH)/src -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar + +# Compile native_app_glue code as static library: obj/libnative_app_glue.a +compile_native_app_glue: + $(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS) + $(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o + +# Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so +compile_project_code: $(OBJS) + $(CC) -o $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) + +# Compile all .c files required into object (.o) files +# NOTE: Those files will be linked into a shared library +$(PROJECT_BUILD_PATH)/obj/%.o:%.c + $(CC) -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot + +# Compile project .java code into .class (Java bytecode) +compile_project_class: + $(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar;$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java + +# Compile .class files into Dalvik executable bytecode (.dex) +# NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT) +compile_project_class_dex: + $(ANDROID_BUILD_TOOLS)/dx --verbose --dex --output=$(PROJECT_BUILD_PATH)/bin/classes.dex $(PROJECT_BUILD_PATH)/obj + +# Create Android APK package: bin/$(PROJECT_NAME).unsigned.apk +# NOTE: Requires compiled classes.dex and lib$(PROJECT_LIBRARY_NAME).so +# NOTE: Use -A resources to define additional directory in which to find raw asset files +create_project_apk_package: + $(ANDROID_BUILD_TOOLS)/aapt package -f -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -S $(PROJECT_BUILD_PATH)/res -A $(PROJECT_BUILD_PATH)/assets -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar -F $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_BUILD_PATH)/bin + cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) + +# Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk +sign_project_apk_package: + $(JAVA_HOME)/bin/jarsigner -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -signedjar $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_NAME)Key + +# Create zip-aligned APK package: $(PROJECT_NAME).apk +zipalign_project_apk_package: + $(ANDROID_BUILD_TOOLS)/zipalign -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_NAME).apk + +# Install $(PROJECT_NAME).apk to default emulator/device +# NOTE: Use -e (emulator) or -d (device) parameters if required +install: + $(ANDROID_PLATFORM_TOOLS)/adb install --abi $(ANDROID_ARCH_NAME) -rds $(PROJECT_NAME).apk + +# Check supported ABI for the device (armeabi-v7a, arm64-v8a, x86, x86_64) +check_device_abi: + $(ANDROID_PLATFORM_TOOLS)/adb shell getprop ro.product.cpu.abi + +# Monitorize output log coming from device, only raylib tag +logcat: + $(ANDROID_PLATFORM_TOOLS)/adb logcat -c + $(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S + +# Install and monitorize $(PROJECT_NAME).apk to default emulator/device +deploy: + $(ANDROID_PLATFORM_TOOLS)/adb install -r $(PROJECT_NAME).apk + $(ANDROID_PLATFORM_TOOLS)/adb logcat -c + $(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S + +#$(ANDROID_PLATFORM_TOOLS)/adb logcat *:W + +# Clean everything +clean: + del $(PROJECT_BUILD_PATH)\* /f /s /q + rmdir $(PROJECT_BUILD_PATH) /s /q + @echo Cleaning done diff --git a/projects/4coder/game b/projects/4coder/game new file mode 100644 index 00000000..b282258c Binary files /dev/null and b/projects/4coder/game differ diff --git a/projects/4coder/main.c b/projects/4coder/main.c new file mode 100644 index 00000000..e7918422 --- /dev/null +++ b/projects/4coder/main.c @@ -0,0 +1,39 @@ +#include +#include "raylib.h" + +int main() { + int screenWidth = 800; + int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib"); + + Camera cam; + cam.position = (Vector3){ 0.f, 10.f, 8.f }; + cam.target = (Vector3){ 0.f, 0.f, 0.f }; + cam.up = (Vector3){ 0.f, 1.f, 0.f }; + cam.fovy = 60.f; + cam.type = CAMERA_PERSPECTIVE; + + Vector3 cubePos = { 0.f, 0.f, 0.f }; + + SetTargetFPS(60); + + while (!WindowShouldClose()) { + cam.position.x = sin(GetTime()) * 10.f; + cam.position.z = cos(GetTime()) * 10.f; + + BeginDrawing(); + ClearBackground(RAYWHITE); + BeginMode3D(cam); + DrawCube(cubePos, 2.f, 2.f, 2.f, RED); + DrawCubeWires(cubePos, 2.f, 2.f, 2.f, MAROON); + DrawGrid(10, 1.f); + EndMode3D(); + DrawText("This is a raylib example", 10, 40, 20, DARKGRAY); + DrawFPS(10, 10); + EndDrawing(); + } + + CloseWindow(); + return 0; +} \ No newline at end of file diff --git a/projects/4coder/project.4coder b/projects/4coder/project.4coder new file mode 100644 index 00000000..e466bb4f --- /dev/null +++ b/projects/4coder/project.4coder @@ -0,0 +1,54 @@ +version(1); + +project_name = "raylib-example"; + +patterns = { +"*.cpp", +"*.c", +"*.h", +"*.bat", +"*.sh", +"*.4coder", +"Makefile", +}; + +blacklist_patterns = { +".*", +}; + +load_paths = { + { { {".", .relative = true, .recursive = true, } }, .os = "win" }, + { { {".", .relative = true, .recursive = true, } }, .os = "linux" }, + { { {".", .relative = true, .recursive = true, } }, .os = "mac" }, +}; + +command_list = { + { .name = "clean", + .out = "*clean*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true, + .cmd = { + {"mingw32-make clean", .os = "win"}, + {"make clean", .os = "linux"}, + {"make clean", .os = "mac"}, + }, + }, + { .name = "build", + .out = "*compile*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, + .cmd = { + {"mingw32-make", .os = "win"}, + {"make", .os = "linux"}, + {"make", .os = "mac"}, + }, + }, + { .name = "run", + .out = "*run*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true, + .cmd = { + {"./game.exe", .os = "win"}, + {"./game", .os = "linux"}, + {"./game", .os = "mac"}, + }, + }, +}; + +fkey_command[3] = "clean"; +fkey_command[4] = "build"; +fkey_command[5] = "run"; -- cgit v1.2.3 From 6d65aa1acbe0bfa3212610ea3de3d71b6dd9324f Mon Sep 17 00:00:00 2001 From: Chris Dill Date: Wed, 24 Apr 2019 10:13:13 +0100 Subject: Removed game binary --- projects/4coder/game | Bin 14480 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 projects/4coder/game (limited to 'projects') diff --git a/projects/4coder/game b/projects/4coder/game deleted file mode 100644 index b282258c..00000000 Binary files a/projects/4coder/game and /dev/null differ -- cgit v1.2.3 From 2de1f318212dbceb71db6be053be995208748f2a Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Sat, 27 Apr 2019 19:33:51 +0100 Subject: UWP Support Overhaul (#819) * Working build * Fix build again, stop deleting files * Hotfix crash, needs investigating * Remove VS2015.UWP, I cannot update the project * Lots of UWP work, added keyboard and mouse press support. Still need to finish scroll wheel, mouse position and cursor hiding, plus other stuff that I haven't seen yet. * Implemented a ton more things, added BaseApp.h to provide common code to UWP apps. * Remove constant window dimensions * Enable and Disable cursor support. * Actually use mouse delta * Gamepad Support * Cleaning and small tweaks * Restore original example. * Update comment * Use 'Messages' to handle the cursor functions so code is more portable. * Comment * Comment unused message fields and use vector for mouse pos instead. * Move messages to utils.h and use messages for everything. No more plat-specific code in raylib.h * Working build * Fix build again, stop deleting files * Hotfix crash, needs investigating * Remove VS2015.UWP, I cannot update the project * Lots of UWP work, added keyboard and mouse press support. Still need to finish scroll wheel, mouse position and cursor hiding, plus other stuff that I haven't seen yet. * Implemented a ton more things, added BaseApp.h to provide common code to UWP apps. * Remove constant window dimensions * Enable and Disable cursor support. * Actually use mouse delta * Gamepad Support * Cleaning and small tweaks * Restore original example. * Update comment * Use 'Messages' to handle the cursor functions so code is more portable. * Comment * Comment unused message fields and use vector for mouse pos instead. * Move messages to utils.h and use messages for everything. No more plat-specific code in raylib.h * Tested some desktop stuff and added projection matrix updates for window resizing. * Fixed big bad mouse bug * Fix alt buttons and add hack to combat flickery key presses (far from perfect) * Remove debug code * Final commit * Well, so I thought * Wow, i am bad * Remove packages folder * Remove useless include * Apply requested changes and fix linux build * Try to stop packages folder * Have we fixed the formatting properly? * Third time's the charm? * Where did this come from? * Re-fix * Autoformat is gonna kill * Fixed XBOX ONE Support * Fix tabs --- projects/VS2015.UWP/raylib.App.UWP/App.cpp | 558 -------------------- projects/VS2015.UWP/raylib.App.UWP/App.h | 49 -- .../raylib.App.UWP/Assets/Logo.scale-100.png | Bin 801 -> 0 bytes .../raylib.App.UWP/Assets/SmallLogo.scale-100.png | Bin 329 -> 0 bytes .../Assets/SplashScreen.scale-100.png | Bin 2146 -> 0 bytes .../raylib.App.UWP/Assets/StoreLogo.scale-100.png | Bin 429 -> 0 bytes .../raylib.App.UWP/Assets/WideLogo.scale-100.png | Bin 2150 -> 0 bytes .../VS2015.UWP/raylib.App.UWP/Package.appxmanifest | 26 - projects/VS2015.UWP/raylib.App.UWP/packages.config | 4 - projects/VS2015.UWP/raylib.App.UWP/pch.cpp | 1 - projects/VS2015.UWP/raylib.App.UWP/pch.h | 16 - .../raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx | Bin 2512 -> 0 bytes .../raylib.App.UWP/raylib.App.UWP.filters | 42 -- .../VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user | 4 - .../raylib.App.UWP/raylib.App.UWP.vcxproj | 145 ------ projects/VS2015.UWP/raylib.UWP.sln | 51 -- projects/VS2015.UWP/raylib/raylib.vcxproj | 182 ------- projects/VS2017.UWP/raylib.App.UWP/App.cpp | 78 +++ projects/VS2017.UWP/raylib.App.UWP/App.h | 25 + .../raylib.App.UWP/Assets/Logo.scale-100.png | Bin 0 -> 801 bytes .../raylib.App.UWP/Assets/SmallLogo.scale-100.png | Bin 0 -> 329 bytes .../Assets/SplashScreen.scale-100.png | Bin 0 -> 2146 bytes .../raylib.App.UWP/Assets/StoreLogo.scale-100.png | Bin 0 -> 429 bytes .../raylib.App.UWP/Assets/WideLogo.scale-100.png | Bin 0 -> 2150 bytes projects/VS2017.UWP/raylib.App.UWP/BaseApp.h | 567 +++++++++++++++++++++ .../VS2017.UWP/raylib.App.UWP/Package.appxmanifest | 26 + projects/VS2017.UWP/raylib.App.UWP/packages.config | 4 + projects/VS2017.UWP/raylib.App.UWP/pch.cpp | 1 + projects/VS2017.UWP/raylib.App.UWP/pch.h | 16 + .../raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx | Bin 0 -> 2512 bytes .../raylib.App.UWP/raylib.App.UWP.filters | 42 ++ .../raylib.App.UWP/raylib.App.UWP.vcxproj | 151 ++++++ projects/VS2017.UWP/raylib.UWP.sln | 57 +++ projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj | 231 +++++++++ .../raylib.UWP/raylib.UWP.vcxproj.filters | 29 ++ 35 files changed, 1227 insertions(+), 1078 deletions(-) delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/App.cpp delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/App.h delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/Package.appxmanifest delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/packages.config delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/pch.cpp delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/pch.h delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.filters delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user delete mode 100644 projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj delete mode 100644 projects/VS2015.UWP/raylib.UWP.sln delete mode 100644 projects/VS2015.UWP/raylib/raylib.vcxproj create mode 100644 projects/VS2017.UWP/raylib.App.UWP/App.cpp create mode 100644 projects/VS2017.UWP/raylib.App.UWP/App.h create mode 100644 projects/VS2017.UWP/raylib.App.UWP/Assets/Logo.scale-100.png create mode 100644 projects/VS2017.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png create mode 100644 projects/VS2017.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png create mode 100644 projects/VS2017.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png create mode 100644 projects/VS2017.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png create mode 100644 projects/VS2017.UWP/raylib.App.UWP/BaseApp.h create mode 100644 projects/VS2017.UWP/raylib.App.UWP/Package.appxmanifest create mode 100644 projects/VS2017.UWP/raylib.App.UWP/packages.config create mode 100644 projects/VS2017.UWP/raylib.App.UWP/pch.cpp create mode 100644 projects/VS2017.UWP/raylib.App.UWP/pch.h create mode 100644 projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx create mode 100644 projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.filters create mode 100644 projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj create mode 100644 projects/VS2017.UWP/raylib.UWP.sln create mode 100644 projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj create mode 100644 projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters (limited to 'projects') diff --git a/projects/VS2015.UWP/raylib.App.UWP/App.cpp b/projects/VS2015.UWP/raylib.App.UWP/App.cpp deleted file mode 100644 index 6ce6915c..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/App.cpp +++ /dev/null @@ -1,558 +0,0 @@ -#include "pch.h" -#include "app.h" - -#include "raylib.h" - -using namespace Windows::ApplicationModel::Core; -using namespace Windows::ApplicationModel::Activation; -using namespace Windows::UI::Core; -using namespace Windows::UI::Input; -using namespace Windows::Devices::Input; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::Gaming::Input; -using namespace Windows::Graphics::Display; -using namespace Microsoft::WRL; -using namespace Platform; - -using namespace raylibUWP; - -/* -TODO list: - - Cache reference to our CoreWindow? - - Implement gestures support -*/ - -// Declare uwpWindow as exter to be used by raylib internals -// NOTE: It should be properly assigned before calling InitWindow() -extern "C" { EGLNativeWindowType uwpWindow; }; - -/* INPUT CODE */ -// Stand-ins for "core.c" variables -#define MAX_GAMEPADS 4 // Max number of gamepads supported -#define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad) -#define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) - -static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready -static float gamepadAxisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state -static char previousGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state -static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state - -static char previousKeyState[512] = { 0 }; // Contains previous frame keyboard state -static char currentKeyState[512] = { 0 }; // Contains current frame keyboard state - -static char previousMouseState[3] = { 0 }; // Registers previous mouse button state -static char currentMouseState[3] = { 0 }; // Registers current mouse button state -static int previousMouseWheelY = 0; // Registers previous mouse wheel variation -static int currentMouseWheelY = 0; // Registers current mouse wheel variation - -static bool cursorOnScreen = false; // Tracks if cursor is inside client area -static bool cursorHidden = false; // Track if cursor is hidden - -static Vector2 mousePosition; -static Vector2 mouseDelta; // NOTE: Added to keep track of mouse movement while the cursor is locked - no equivalent in "core.c" -static bool toggleCursorLock; - -CoreCursor ^regularCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); // The "visible arrow" cursor type - -// Helper to process key events -void ProcessKeyEvent(Windows::System::VirtualKey key, int action) -{ - using Windows::System::VirtualKey; - switch (key) - { - case VirtualKey::Space: currentKeyState[KEY_SPACE] = action; break; - case VirtualKey::Escape: currentKeyState[KEY_ESCAPE] = action; break; - case VirtualKey::Enter: currentKeyState[KEY_ENTER] = action; break; - case VirtualKey::Delete: currentKeyState[KEY_BACKSPACE] = action; break; - case VirtualKey::Right: currentKeyState[KEY_RIGHT] = action; break; - case VirtualKey::Left: currentKeyState[KEY_LEFT] = action; break; - case VirtualKey::Down: currentKeyState[KEY_DOWN] = action; break; - case VirtualKey::Up: currentKeyState[KEY_UP] = action; break; - case VirtualKey::F1: currentKeyState[KEY_F1] = action; break; - case VirtualKey::F2: currentKeyState[KEY_F2] = action; break; - case VirtualKey::F3: currentKeyState[KEY_F4] = action; break; - case VirtualKey::F4: currentKeyState[KEY_F5] = action; break; - case VirtualKey::F5: currentKeyState[KEY_F6] = action; break; - case VirtualKey::F6: currentKeyState[KEY_F7] = action; break; - case VirtualKey::F7: currentKeyState[KEY_F8] = action; break; - case VirtualKey::F8: currentKeyState[KEY_F9] = action; break; - case VirtualKey::F9: currentKeyState[KEY_F10] = action; break; - case VirtualKey::F10: currentKeyState[KEY_F11] = action; break; - case VirtualKey::F11: currentKeyState[KEY_F12] = action; break; - case VirtualKey::LeftShift: currentKeyState[KEY_LEFT_SHIFT] = action; break; - case VirtualKey::LeftControl: currentKeyState[KEY_LEFT_CONTROL] = action; break; - case VirtualKey::LeftMenu: currentKeyState[KEY_LEFT_ALT] = action; break; // NOTE: Potential UWP bug with Alt key: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/9bebfb0a-7637-400e-8bda-e55620091407/unexpected-behavior-in-windowscoreuicorephysicalkeystatusismenukeydown - case VirtualKey::RightShift: currentKeyState[KEY_RIGHT_SHIFT] = action; break; - case VirtualKey::RightControl: currentKeyState[KEY_RIGHT_CONTROL] = action; break; - case VirtualKey::RightMenu: currentKeyState[KEY_RIGHT_ALT] = action; break; - case VirtualKey::Number0: currentKeyState[KEY_ZERO] = action; break; - case VirtualKey::Number1: currentKeyState[KEY_ONE] = action; break; - case VirtualKey::Number2: currentKeyState[KEY_TWO] = action; break; - case VirtualKey::Number3: currentKeyState[KEY_THREE] = action; break; - case VirtualKey::Number4: currentKeyState[KEY_FOUR] = action; break; - case VirtualKey::Number5: currentKeyState[KEY_FIVE] = action; break; - case VirtualKey::Number6: currentKeyState[KEY_SIX] = action; break; - case VirtualKey::Number7: currentKeyState[KEY_SEVEN] = action; break; - case VirtualKey::Number8: currentKeyState[KEY_EIGHT] = action; break; - case VirtualKey::Number9: currentKeyState[KEY_NINE] = action; break; - case VirtualKey::A: currentKeyState[KEY_A] = action; break; - case VirtualKey::B: currentKeyState[KEY_B] = action; break; - case VirtualKey::C: currentKeyState[KEY_C] = action; break; - case VirtualKey::D: currentKeyState[KEY_D] = action; break; - case VirtualKey::E: currentKeyState[KEY_E] = action; break; - case VirtualKey::F: currentKeyState[KEY_F] = action; break; - case VirtualKey::G: currentKeyState[KEY_G] = action; break; - case VirtualKey::H: currentKeyState[KEY_H] = action; break; - case VirtualKey::I: currentKeyState[KEY_I] = action; break; - case VirtualKey::J: currentKeyState[KEY_J] = action; break; - case VirtualKey::K: currentKeyState[KEY_K] = action; break; - case VirtualKey::L: currentKeyState[KEY_L] = action; break; - case VirtualKey::M: currentKeyState[KEY_M] = action; break; - case VirtualKey::N: currentKeyState[KEY_N] = action; break; - case VirtualKey::O: currentKeyState[KEY_O] = action; break; - case VirtualKey::P: currentKeyState[KEY_P] = action; break; - case VirtualKey::Q: currentKeyState[KEY_Q] = action; break; - case VirtualKey::R: currentKeyState[KEY_R] = action; break; - case VirtualKey::S: currentKeyState[KEY_S] = action; break; - case VirtualKey::T: currentKeyState[KEY_T] = action; break; - case VirtualKey::U: currentKeyState[KEY_U] = action; break; - case VirtualKey::V: currentKeyState[KEY_V] = action; break; - case VirtualKey::W: currentKeyState[KEY_W] = action; break; - case VirtualKey::X: currentKeyState[KEY_X] = action; break; - case VirtualKey::Y: currentKeyState[KEY_Y] = action; break; - case VirtualKey::Z: currentKeyState[KEY_Z] = action; break; - - } -} - -// Callbacks -void App::PointerPressed(CoreWindow^ window, PointerEventArgs^ args) -{ - if (args->CurrentPoint->Properties->IsLeftButtonPressed) - { - currentMouseState[MOUSE_LEFT_BUTTON] = 1; - } - if (args->CurrentPoint->Properties->IsRightButtonPressed) - { - currentMouseState[MOUSE_RIGHT_BUTTON] = 1; - } - if (args->CurrentPoint->Properties->IsMiddleButtonPressed) - { - currentMouseState[MOUSE_MIDDLE_BUTTON] = 1; - } -} - -void App::PointerReleased(CoreWindow ^window, PointerEventArgs^ args) -{ - if (!(args->CurrentPoint->Properties->IsLeftButtonPressed)) - { - currentMouseState[MOUSE_LEFT_BUTTON] = 0; - } - if (!(args->CurrentPoint->Properties->IsRightButtonPressed)) - { - currentMouseState[MOUSE_RIGHT_BUTTON] = 0; - } - if (!(args->CurrentPoint->Properties->IsMiddleButtonPressed)) - { - currentMouseState[MOUSE_MIDDLE_BUTTON] = 0; - } -} - -void App::PointerWheelChanged(CoreWindow ^window, PointerEventArgs^ args) -{ - // TODO: Scale the MouseWheelDelta to match GLFW's mouse wheel sensitivity. - currentMouseWheelY += args->CurrentPoint->Properties->MouseWheelDelta; -} - -void App::MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args) -{ - mouseDelta.x += args->MouseDelta.X; - mouseDelta.y += args->MouseDelta.Y; -} - -void App::OnKeyDown(CoreWindow ^ sender, KeyEventArgs ^ args) -{ - ProcessKeyEvent(args->VirtualKey, 1); -} - -void App::OnKeyUp(CoreWindow ^ sender, KeyEventArgs ^ args) -{ - ProcessKeyEvent(args->VirtualKey, 0); -} - -/* REIMPLEMENTED FROM CORE.C */ -// Get one key state -static bool GetKeyStatus(int key) -{ - return currentKeyState[key]; -} - -// Show mouse cursor -void UWPShowCursor() -{ - CoreWindow::GetForCurrentThread()->PointerCursor = regularCursor; - cursorHidden = false; -} - -// Hides mouse cursor -void UWPHideCursor() -{ - CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; - cursorHidden = true; -} - -// Set mouse position XY -void UWPSetMousePosition(Vector2 position) -{ - CoreWindow ^window = CoreWindow::GetForCurrentThread(); - Point mousePosScreen = Point(position.x + window->Bounds.X, position.y + window->Bounds.Y); - window->PointerPosition = mousePosScreen; - mousePosition = position; -} - -// Enables cursor (unlock cursor) -void UWPEnableCursor() -{ - UWPShowCursor(); - UWPSetMousePosition(mousePosition); // The mouse is hidden in the center of the screen - move it to where it should appear - toggleCursorLock = false; -} - -// Disables cursor (lock cursor) -void UWPDisableCursor() -{ - UWPHideCursor(); - toggleCursorLock = true; -} - -// Get one mouse button state -static bool UWPGetMouseButtonStatus(int button) -{ - return currentMouseState[button]; -} - -// Poll (store) all input events -void UWP_PollInput() -{ - // Register previous keyboard state - for (int k = 0; k < 512; k++) previousKeyState[k] = currentKeyState[k]; - - // Process Mouse - { - // Register previous mouse states - for (int i = 0; i < 3; i++) previousMouseState[i] = currentMouseState[i]; - previousMouseWheelY = currentMouseWheelY; - currentMouseWheelY = 0; - - CoreWindow ^window = CoreWindow::GetForCurrentThread(); - if (toggleCursorLock) - { - // Track cursor movement delta, recenter it on the client - mousePosition.x += mouseDelta.x; - mousePosition.y += mouseDelta.y; - - // Why we're not using UWPSetMousePosition here... - // UWPSetMousePosition changes the "mousePosition" variable to match where the cursor actually is. - // Our cursor is locked to the middle of screen, and we don't want that reflected in "mousePosition" - Vector2 centerClient = { (float)(GetScreenWidth() / 2), (float)(GetScreenHeight() / 2) }; - window->PointerPosition = Point(centerClient.x + window->Bounds.X, centerClient.y + window->Bounds.Y); - } - else - { - // Record the cursor's position relative to the client - mousePosition.x = window->PointerPosition.X - window->Bounds.X; - mousePosition.y = window->PointerPosition.Y - window->Bounds.Y; - } - - mouseDelta = { 0 ,0 }; - } - - // Process Gamepads - { - // Check if gamepads are ready - for (int i = 0; i < MAX_GAMEPADS; i++) - { - // HACK: UWP keeps a contiguous list of gamepads. For the interest of time I'm just doing a 1:1 mapping of - // connected gamepads with their spot in the list, but this has serious robustness problems - // e.g. player 1, 2, and 3 are playing a game - if player2 disconnects, p3's controller would now be mapped to p2's character since p3 is now second in the list. - - gamepadReady[i] = (i < Gamepad::Gamepads->Size); - } - - // Get current gamepad state - for (int i = 0; i < MAX_GAMEPADS; i++) - { - if (gamepadReady[i]) - { - // Register previous gamepad states - for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k]; - - // Get current gamepad state - auto gamepad = Gamepad::Gamepads->GetAt(i); - GamepadReading reading = gamepad->GetCurrentReading(); - - // NOTE: Maybe it would be wiser to redefine the gamepad button mappings in "raylib.h" for the UWP platform instead of remapping them manually - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_A] = ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_B] = ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_X] = ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_Y] = ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_LB] = ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_RB] = ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_SELECT] = ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View); // Changed for XB1 Controller - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_START] = ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu); // Changed for XB1 Controller - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_UP] = ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_RIGHT] = ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_DOWN] = ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadDown); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_LEFT] = ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadLeft); - currentGamepadState[i][GAMEPAD_XBOX_BUTTON_HOME] = false; // Home button not supported by UWP - - // Get current axis state - gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LEFT_X] = reading.LeftThumbstickX; - gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LEFT_Y] = reading.LeftThumbstickY; - gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RIGHT_X] = reading.RightThumbstickX; - gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RIGHT_Y] = reading.RightThumbstickY; - gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LT] = reading.LeftTrigger; - gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RT] = reading.RightTrigger; - } - } - } - -} - -// The following functions were ripped from core.c and have *no additional work done on them* -// Detect if a key has been pressed once -bool UWPIsKeyPressed(int key) -{ - bool pressed = false; - - if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 1)) pressed = true; - else pressed = false; - - return pressed; -} - -// Detect if a key is being pressed (key held down) -bool UWPIsKeyDown(int key) -{ - if (GetKeyStatus(key) == 1) return true; - else return false; -} - -// Detect if a key has been released once -bool UWPIsKeyReleased(int key) -{ - bool released = false; - - if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 0)) released = true; - else released = false; - - return released; -} - -// Detect if a key is NOT being pressed (key not held down) -bool UWPIsKeyUp(int key) -{ - if (GetKeyStatus(key) == 0) return true; - else return false; -} - -/* OTHER CODE */ - -// Helper to convert a length in device-independent pixels (DIPs) to a length in physical pixels. -inline float ConvertDipsToPixels(float dips, float dpi) -{ - static const float dipsPerInch = 96.0f; - return floor(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer. -} - -// Implementation of the IFrameworkViewSource interface, necessary to run our app. -ref class SimpleApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource -{ -public: - virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView() - { - return ref new App(); - } -}; - -// The main function creates an IFrameworkViewSource for our app, and runs the app. -[Platform::MTAThread] -int main(Platform::Array^) -{ - auto simpleApplicationSource = ref new SimpleApplicationSource(); - CoreApplication::Run(simpleApplicationSource); - - return 0; -} - -App::App() : - mWindowClosed(false), - mWindowVisible(true) -{ -} - -// The first method called when the IFrameworkView is being created. -void App::Initialize(CoreApplicationView^ applicationView) -{ - // Register event handlers for app lifecycle. This example includes Activated, so that we - // can make the CoreWindow active and start rendering on the window. - applicationView->Activated += ref new TypedEventHandler(this, &App::OnActivated); - - // Logic for other event handlers could go here. - // Information about the Suspending and Resuming event handlers can be found here: - // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh994930.aspx - - CoreApplication::Resuming += ref new EventHandler(this, &App::OnResuming); -} - -// Called when the CoreWindow object is created (or re-created). -void App::SetWindow(CoreWindow^ window) -{ - window->SizeChanged += ref new TypedEventHandler(this, &App::OnWindowSizeChanged); - window->VisibilityChanged += ref new TypedEventHandler(this, &App::OnVisibilityChanged); - window->Closed += ref new TypedEventHandler(this, &App::OnWindowClosed); - - window->PointerPressed += ref new TypedEventHandler(this, &App::PointerPressed); - window->PointerReleased += ref new TypedEventHandler(this, &App::PointerReleased); - window->PointerWheelChanged += ref new TypedEventHandler(this, &App::PointerWheelChanged); - window->KeyDown += ref new TypedEventHandler(this, &App::OnKeyDown); - window->KeyUp += ref new TypedEventHandler(this, &App::OnKeyUp); - - Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler(this, &App::MouseMoved); - - DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); - currentDisplayInformation->DpiChanged += ref new TypedEventHandler(this, &App::OnDpiChanged); - currentDisplayInformation->OrientationChanged += ref new TypedEventHandler(this, &App::OnOrientationChanged); - - // The CoreWindow has been created, so EGL can be initialized. - - uwpWindow = (EGLNativeWindowType)window; - - InitWindow(800, 450, NULL); -} - -// Initializes scene resources -void App::Load(Platform::String^ entryPoint) -{ - // InitWindow() --> rlglInit() -} - -static int posX = 100; -static int posY = 100; -static int time = 0; -// This method is called after the window becomes active. -void App::Run() -{ - while (!mWindowClosed) - { - if (mWindowVisible) - { - // Draw - BeginDrawing(); - - ClearBackground(RAYWHITE); - - posX += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_X] * 5; - posY += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_Y] * -5; - DrawRectangle(posX, posY, 400, 100, RED); - - DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); - - DrawCircle(mousePosition.x, mousePosition.y, 40, BLUE); - - if (UWPIsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); - - if (UWPIsKeyPressed(KEY_A)) - { - posX -= 50; - UWPEnableCursor(); - } - - if (UWPIsKeyPressed(KEY_D)) - { - posX += 50; - UWPDisableCursor(); - } - - if (currentKeyState[KEY_LEFT_ALT]) DrawRectangle(250, 250, 20, 20, BLACK); - if (currentKeyState[KEY_BACKSPACE]) DrawRectangle(280, 250, 20, 20, BLACK); - if (currentMouseState[MOUSE_LEFT_BUTTON]) DrawRectangle(280, 250, 20, 20, BLACK); - - static int pos = 0; - pos -= currentMouseWheelY; - - DrawRectangle(280, pos + 50, 20, 20, BLACK); - DrawRectangle(250, 280 + (time++ % 60), 10, 10, PURPLE); - - EndDrawing(); - - UWP_PollInput(); - - CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); - } - else - { - CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); - } - } - - CloseWindow(); -} - -// Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView -// class is torn down while the app is in the foreground. -void App::Uninitialize() -{ - // CloseWindow(); -} - -// Application lifecycle event handler. -void App::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) -{ - // Run() won't start until the CoreWindow is activated. - CoreWindow::GetForCurrentThread()->Activate(); -} - -void App::OnResuming(Object^ sender, Object^ args) -{ - // Restore any data or state that was unloaded on suspend. By default, data - // and state are persisted when resuming from suspend. Note that this event - // does not occur if the app was previously terminated. -} - -void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) -{ - // TODO: Update window and render area size - //m_deviceResources->SetLogicalSize(Size(sender->Bounds.Width, sender->Bounds.Height)); - //m_main->UpdateForWindowSizeChange(); -} - -// Window event handlers. -void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) -{ - mWindowVisible = args->Visible; - - // raylib core has the variable windowMinimized to register state, - // it should be modifyed by this event... -} - -void App::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) -{ - mWindowClosed = true; - - // raylib core has the variable windowShouldClose to register state, - // it should be modifyed by this event... -} - -void App::OnDpiChanged(DisplayInformation^ sender, Object^ args) -{ - //m_deviceResources->SetDpi(sender->LogicalDpi); - //m_main->UpdateForWindowSizeChange(); -} - -void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args) -{ - //m_deviceResources->SetCurrentOrientation(sender->CurrentOrientation); - //m_main->UpdateForWindowSizeChange(); -} diff --git a/projects/VS2015.UWP/raylib.App.UWP/App.h b/projects/VS2015.UWP/raylib.App.UWP/App.h deleted file mode 100644 index 5b58528b..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/App.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include - -#include "pch.h" - -namespace raylibUWP -{ - ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView - { - public: - App(); - - // IFrameworkView Methods. - virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView); - virtual void SetWindow(Windows::UI::Core::CoreWindow^ window); - virtual void Load(Platform::String^ entryPoint); - virtual void Run(); - virtual void Uninitialize(); - - protected: - - // Application lifecycle event handlers. - void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args); - void OnResuming(Platform::Object^ sender, Platform::Object^ args); - - // Window event handlers. - void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); - void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); - - // DisplayInformation event handlers. - void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args); - void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args); - - // Input event handlers - void PointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void PointerReleased(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args); - void PointerWheelChanged(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args); - void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args); - void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args); - void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args); - - private: - - bool mWindowClosed; - bool mWindowVisible; - }; -} diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png b/projects/VS2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png deleted file mode 100644 index e26771cb..00000000 Binary files a/projects/VS2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png and /dev/null differ diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png b/projects/VS2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png deleted file mode 100644 index 1eb0d9d5..00000000 Binary files a/projects/VS2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png and /dev/null differ diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png b/projects/VS2015.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png deleted file mode 100644 index c951e031..00000000 Binary files a/projects/VS2015.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png b/projects/VS2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png deleted file mode 100644 index dcb67271..00000000 Binary files a/projects/VS2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png and /dev/null differ diff --git a/projects/VS2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png b/projects/VS2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png deleted file mode 100644 index 9dd94b62..00000000 Binary files a/projects/VS2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png and /dev/null differ diff --git a/projects/VS2015.UWP/raylib.App.UWP/Package.appxmanifest b/projects/VS2015.UWP/raylib.App.UWP/Package.appxmanifest deleted file mode 100644 index 56020a50..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/Package.appxmanifest +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - raylibUWP - raysan5 - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.App.UWP/packages.config b/projects/VS2015.UWP/raylib.App.UWP/packages.config deleted file mode 100644 index 70c3dea0..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.App.UWP/pch.cpp b/projects/VS2015.UWP/raylib.App.UWP/pch.cpp deleted file mode 100644 index bcb5590b..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pch.h" diff --git a/projects/VS2015.UWP/raylib.App.UWP/pch.h b/projects/VS2015.UWP/raylib.App.UWP/pch.h deleted file mode 100644 index dcbd2378..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/pch.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include - -// OpenGL ES includes -#include -#include - -// EGL includes -#include -#include -#include - -// ANGLE include for Windows Store -#include \ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx b/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx deleted file mode 100644 index 0ada3be0..00000000 Binary files a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx and /dev/null differ diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.filters b/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.filters deleted file mode 100644 index 4e83c979..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.filters +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - - - - - - - - - - - - {d16954bb-de54-472b-ac10-ecab10d3fdc8} - - - \ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user b/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user deleted file mode 100644 index abe8dd89..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj deleted file mode 100644 index f20a276e..00000000 --- a/projects/VS2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - Debug - ARM - - - Release - ARM - - - - {b842558c-c034-4e4b-9457-a286f26e83cc} - raylibUWP - en-US - 14.0 - true - Windows Store - 10.0.14393.0 - 10.0.14393.0 - 10.0 - raylib.App.UWP - - - - Application - true - v140 - - - Application - false - true - v140 - - - - - - - - raylib.App.UWP.TemporaryKey.pfx - - - $(IncludePath) - $(LibraryPath) - - - - mincore.lib;raylib.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\arm;$(VCInstallDir)\lib\arm;$(SolutionDir)\raylib\Debug - - - - - mincore.lib;raylib.lib;%(AdditionalDependencies) - $(SolutionDir)raylib\Debug;%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib - - - - - mincore.lib;raylib.lib;%(AdditionalDependencies) - C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\x64\Debug;C:\Users\Alumno\Downloads\angle\UWP_OpenGLES2\raylib;%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64 - - - - - pch.h - $(IntDir)pch.pch - $(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories) - /bigobj %(AdditionalOptions) - 4453;28204 - _DEBUG;%(PreprocessorDefinitions) - - - true - - - - - pch.h - $(IntDir)pch.pch - $(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories) - /bigobj %(AdditionalOptions) - 4453;28204 - NDEBUG;%(PreprocessorDefinitions) - Default - false - - - /NODEFAULTLIB %(AdditionalOptions) - - - - - - - - - - - - - - - - - Create - - - - - Designer - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/projects/VS2015.UWP/raylib.UWP.sln b/projects/VS2015.UWP/raylib.UWP.sln deleted file mode 100644 index 087e84f4..00000000 --- a/projects/VS2015.UWP/raylib.UWP.sln +++ /dev/null @@ -1,51 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib.App.UWP", "raylib.App.UWP\raylib.App.UWP.vcxproj", "{B842558C-C034-4E4B-9457-A286F26E83CC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.ActiveCfg = Debug|ARM - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Build.0 = Debug|ARM - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Deploy.0 = Debug|ARM - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.ActiveCfg = Debug|x64 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Build.0 = Debug|x64 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Deploy.0 = Debug|x64 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.ActiveCfg = Debug|Win32 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Build.0 = Debug|Win32 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Deploy.0 = Debug|Win32 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.ActiveCfg = Release|ARM - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Build.0 = Release|ARM - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Deploy.0 = Release|ARM - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.ActiveCfg = Release|x64 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Build.0 = Release|x64 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Deploy.0 = Release|x64 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.ActiveCfg = Release|Win32 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Build.0 = Release|Win32 - {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Deploy.0 = Release|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|ARM.ActiveCfg = Debug|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|ARM.Build.0 = Debug|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.ActiveCfg = Debug|x64 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.ActiveCfg = Debug|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.Build.0 = Debug|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|ARM.ActiveCfg = Release|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.ActiveCfg = Release|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/projects/VS2015.UWP/raylib/raylib.vcxproj b/projects/VS2015.UWP/raylib/raylib.vcxproj deleted file mode 100644 index ed8eb80b..00000000 --- a/projects/VS2015.UWP/raylib/raylib.vcxproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {E89D61AC-55DE-4482-AFD4-DF7242EBC859} - Win32Proj - raylib - 10.0.16299.0 - - - - StaticLibrary - true - v140 - Unicode - - - StaticLibrary - true - v140 - Unicode - - - StaticLibrary - false - v140 - true - Unicode - - - StaticLibrary - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)$(ProjectName)\$(Configuration)\ - - - - $(SolutionDir)$(ProjectName)\$(Configuration)\ - $(SolutionDir)$(ProjectName)\$(Configuration)\temp - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP - CompileAsC - $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE - - - Windows - - - %(AdditionalLibraryDirectories) - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP - CompileAsC - $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\include\ANGLE - - - Windows - - - %(AdditionalLibraryDirectories) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP - $(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include - CompileAsC - - - Windows - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP - $(SolutionDir)..\..\src\external\include\ANGLE;$(SolutionDir)..\..\release\include - CompileAsC - - - Windows - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp new file mode 100644 index 00000000..ae137ed2 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -0,0 +1,78 @@ +#include "pch.h" +#include "app.h" + +#include "raylib.h" + +using namespace raylibUWP; + +// The main function creates an IFrameworkViewSource for our app, and runs the app. +[Platform::MTAThread] +int main(Platform::Array^) +{ + auto appSource = ref new ApplicationSource(); + CoreApplication::Run(appSource); + + return 0; +} + +App::App() +{ + //This does not work... need to fix this. + SetConfigFlags(0); + + Setup(640, 480); +} + +static int posX = 100; +static int posY = 100; +static int gTime = 0; + +// This method is called every frame +void App::Update() +{ + //return; + // Draw + BeginDrawing(); + + ClearBackground(RAYWHITE); + + posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y) * -5; + + DrawRectangle(posX, posY, 400, 100, RED); + + DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); + + auto mPos = GetMousePosition(); + + DrawCircle(mPos.x, mPos.y, 40, BLUE); + + if (IsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); + + if (IsKeyPressed(KEY_A)) + { + posX -= 50; + EnableCursor(); + } + + if (IsKeyPressed(KEY_D)) + { + posX += 50; + DisableCursor(); + } + + if (IsKeyDown(KEY_LEFT_ALT)) + DrawRectangle(250, 250, 20, 20, BLACK); + if (IsKeyDown(KEY_BACKSPACE)) + DrawRectangle(280, 250, 20, 20, BLACK); + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + DrawRectangle(280, 250, 20, 20, BLACK); + + static int pos = 0; + pos -= GetMouseWheelMove(); + + DrawRectangle(280, pos + 50, 20, 20, BLACK); + DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE); + + EndDrawing(); +} \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.h b/projects/VS2017.UWP/raylib.App.UWP/App.h new file mode 100644 index 00000000..26c1d400 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/App.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +#include "pch.h" + +//Define what header we use for BaseApp.h +#define PCH "pch.h" + +//Enable hold hack +#define HOLDHACK + +#include "BaseApp.h" + +namespace raylibUWP +{ + ref class App sealed : public BaseApp + { + public: + App(); + + // IFrameworkView Methods. + void Update() override; + }; +} diff --git a/projects/VS2017.UWP/raylib.App.UWP/Assets/Logo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/Logo.scale-100.png new file mode 100644 index 00000000..e26771cb Binary files /dev/null and b/projects/VS2017.UWP/raylib.App.UWP/Assets/Logo.scale-100.png differ diff --git a/projects/VS2017.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png new file mode 100644 index 00000000..1eb0d9d5 Binary files /dev/null and b/projects/VS2017.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png differ diff --git a/projects/VS2017.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png new file mode 100644 index 00000000..c951e031 Binary files /dev/null and b/projects/VS2017.UWP/raylib.App.UWP/Assets/SplashScreen.scale-100.png differ diff --git a/projects/VS2017.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png new file mode 100644 index 00000000..dcb67271 Binary files /dev/null and b/projects/VS2017.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png differ diff --git a/projects/VS2017.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png b/projects/VS2017.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png new file mode 100644 index 00000000..9dd94b62 Binary files /dev/null and b/projects/VS2017.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png differ diff --git a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h new file mode 100644 index 00000000..e27909e2 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h @@ -0,0 +1,567 @@ +/********************************************************************************************** +* +* raylib.BaseApp - UWP App generic code for managing interface between C and C++ +* +* LICENSE: zlib/libpng +* +* CONFIGURATION: +* +* #define PCH +* This defines what header is the PCH and needs to be included +* +* #define HOLDHACK +* This enables a hack to fix flickering key presses (Temporary) +* +* Copyright (c) 2013-2019 Ramon Santamaria (@raysan5) +* +* This software is provided "as-is", without any express or implied warranty. In no event +* will the authors be held liable for any damages arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, including commercial +* applications, and to alter it and redistribute it freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not claim that you +* wrote the original software. If you use this software in a product, an acknowledgment +* in the product documentation would be appreciated but is not required. +* +* 2. Altered source versions must be plainly marked as such, and must not be misrepresented +* as being the original software. +* +* 3. This notice may not be removed or altered from any source distribution. +* +**********************************************************************************************/ + +#pragma once + +#if defined(PCH) +#include PCH +#endif + +#include +#include +#include + +//EGL +#include + +#include "raylib.h" +#include "utils.h" + +using namespace Windows::ApplicationModel::Core; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::UI::Core; +using namespace Windows::UI::Input; +using namespace Windows::Devices::Input; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::Gaming::Input; +using namespace Windows::Graphics::Display; +using namespace Microsoft::WRL; +using namespace Platform; + +extern "C" { EGLNativeWindowType uwpWindow; }; + +/* +TODO list: + - Cache reference to our CoreWindow? + - Implement gestures support +*/ + +// Stand-ins for "core.c" variables +#define MAX_GAMEPADS 4 // Max number of gamepads supported +#define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad) +#define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) + +//Mouse cursor locking +bool cursorLocked = false; +Vector2 mouseDelta = {0, 0}; + +//Our mouse cursor +CoreCursor ^regularCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); // The "visible arrow" cursor type + +//Base app implementation +ref class BaseApp : public Windows::ApplicationModel::Core::IFrameworkView +{ +public: + + // IFrameworkView Methods. + virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView) + { + // Register event handlers for app lifecycle. This example includes Activated, so that we + // can make the CoreWindow active and start rendering on the window. + applicationView->Activated += ref new TypedEventHandler(this, &BaseApp::OnActivated); + + // Logic for other event handlers could go here. + // Information about the Suspending and Resuming event handlers can be found here: + // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh994930.aspx + + CoreApplication::Resuming += ref new EventHandler(this, &BaseApp::OnResuming); + } + + virtual void SetWindow(Windows::UI::Core::CoreWindow^ window) + { + window->SizeChanged += ref new TypedEventHandler(this, &BaseApp::OnWindowSizeChanged); + window->VisibilityChanged += ref new TypedEventHandler(this, &BaseApp::OnVisibilityChanged); + window->Closed += ref new TypedEventHandler(this, &BaseApp::OnWindowClosed); + + window->PointerPressed += ref new TypedEventHandler(this, &BaseApp::PointerPressed); + window->PointerWheelChanged += ref new TypedEventHandler(this, &BaseApp::PointerWheelChanged); + window->KeyDown += ref new TypedEventHandler(this, &BaseApp::OnKeyDown); + window->KeyUp += ref new TypedEventHandler(this, &BaseApp::OnKeyUp); + + Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler(this, &BaseApp::MouseMoved); + + DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); + currentDisplayInformation->DpiChanged += ref new TypedEventHandler(this, &BaseApp::OnDpiChanged); + currentDisplayInformation->OrientationChanged += ref new TypedEventHandler(this, &BaseApp::OnOrientationChanged); + + // The CoreWindow has been created, so EGL can be initialized. + + uwpWindow = (EGLNativeWindowType)window; + + InitWindow(width, height, NULL); + } + + virtual void Load(Platform::String^ entryPoint) {} + + void Setup(int width, int height) + { + //Set dimensions + this->width = width; + this->height = height; + } + + virtual void Run() + { + //Get display dimensions + DisplayInformation^ dInfo = DisplayInformation::GetForCurrentView(); + Vector2 screenSize = { dInfo->ScreenWidthInRawPixels, dInfo->ScreenHeightInRawPixels }; + + //Send display dimensions + UWPMessage* msg = CreateUWPMessage(); + msg->Type = SetDisplayDims; + msg->Vector0 = screenSize; + UWPSendMessage(msg); + + //Send the time to the core + using clock = std::chrono::high_resolution_clock; + auto timeStart = clock::now(); + + //Set fps if 0 + if (GetFPS() <= 0) + SetTargetFPS(60); + + while (!mWindowClosed) + { + if (mWindowVisible) + { + //Send time + auto delta = clock::now() - timeStart; + + UWPMessage* timeMsg = CreateUWPMessage(); + timeMsg->Type = SetGameTime; + timeMsg->Double0 = std::chrono::duration_cast(delta).count(); + UWPSendMessage(timeMsg); + + //Call update function + Update(); + + PollInput(); + + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); + } + else + { + CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); + } + } + + CloseWindow(); + } + + //Called every frame (Maybe add draw) + virtual void Update() {} + + virtual void Uninitialize() {} + +protected: + + // Input polling + void PollInput() + { + // Process Messages + { + //Loop over pending messages + while (UWPHasMessages()) + { + //Get the message + auto msg = UWPGetMessage(); + + //Carry out the command + switch(msg->Type) + { + case ShowMouse: //Do the same thing because of how UWP works... + case UnlockMouse: + { + CoreWindow::GetForCurrentThread()->PointerCursor = regularCursor; + cursorLocked = false; + MoveMouse(GetMousePosition()); + break; + } + case HideMouse: //Do the same thing because of how UWP works... + case LockMouse: + { + CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; + cursorLocked = true; + break; + } + case SetMouseLocation: + { + MoveMouse(msg->Vector0); + break; + } + } + + //Delete the message + DeleteUWPMessage(msg); + } + } + + // Process Keyboard + { + for (int k = 0x08; k < 0xA6; k++) { + auto state = CoreWindow::GetForCurrentThread()->GetKeyState((Windows::System::VirtualKey) k); + +#ifdef HOLDHACK + //Super hacky way of waiting three frames to see if we are ready to register the key as deregistered + //This will wait an entire 4 frames before deregistering the key, this makes sure that the key is not flickering + if (KeyboardStateHack[k] == 2) + { + if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) + { + KeyboardStateHack[k] = 3; + } + } + else if (KeyboardStateHack[k] == 3) + { + if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) + { + KeyboardStateHack[k] = 4; + } + } + else if (KeyboardStateHack[k] == 4) + { + if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) + { + //Reset key... + KeyboardStateHack[k] = 0; + + //Tell core + RegisterKey(k, 0); + } + } +#endif + //Left and right alt, KeyUp and KeyDown are not called for it + //No need to hack because this is not a character + + //TODO: Maybe do all other key registrations like this, no more key events? + + if (k == 0xA4 || k == 0xA5) + { + if ((state & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down) + { + RegisterKey(k, 1); + } + else + { + RegisterKey(k, 0); + } + } + } + } + + // Process Mouse + { + + if (CurrentPointerID > -1) { + auto point = PointerPoint::GetCurrentPoint(CurrentPointerID); + auto props = point->Properties; + + if (props->IsLeftButtonPressed) + { + RegisterClick(MOUSE_LEFT_BUTTON, 1); + } + else + { + RegisterClick(MOUSE_LEFT_BUTTON, 0); + } + + if (props->IsRightButtonPressed) + { + RegisterClick(MOUSE_RIGHT_BUTTON, 1); + } + else + { + RegisterClick(MOUSE_RIGHT_BUTTON, 0); + } + + if (props->IsMiddleButtonPressed) + { + RegisterClick(MOUSE_MIDDLE_BUTTON, 1); + } + else + { + RegisterClick(MOUSE_MIDDLE_BUTTON, 0); + } + } + + CoreWindow ^window = CoreWindow::GetForCurrentThread(); + + if (cursorLocked) + { + // Track cursor movement delta, recenter it on the client + auto curMousePos = GetMousePosition(); + + auto x = curMousePos.x + mouseDelta.x; + auto y = curMousePos.y + mouseDelta.y; + + UpdateMousePosition({ x, y }); + + // Why we're not using UWPSetMousePosition here... + // UWPSetMousePosition changes the "mousePosition" variable to match where the cursor actually is. + // Our cursor is locked to the middle of screen, and we don't want that reflected in "mousePosition" + Vector2 centerClient = { (float)(GetScreenWidth() / 2), (float)(GetScreenHeight() / 2) }; + window->PointerPosition = Point(centerClient.x + window->Bounds.X, centerClient.y + window->Bounds.Y); + } + else + { + // Record the cursor's position relative to the client + auto x = window->PointerPosition.X - window->Bounds.X; + auto y = window->PointerPosition.Y - window->Bounds.Y; + + UpdateMousePosition({ x, y }); + } + + mouseDelta = { 0 ,0 }; + } + + // Process Gamepads + { + // Check if gamepads are ready + for (int i = 0; i < MAX_GAMEPADS; i++) + { + // HACK: UWP keeps a contiguous list of gamepads. For the interest of time I'm just doing a 1:1 mapping of + // connected gamepads with their spot in the list, but this has serious robustness problems + // e.g. player 1, 2, and 3 are playing a game - if player2 disconnects, p3's controller would now be mapped to p2's character since p3 is now second in the list. + + UWPMessage* msg = CreateUWPMessage(); + msg->Type = MarkGamepadActive; + msg->Int0 = i; + msg->Bool0 = i < Gamepad::Gamepads->Size; + UWPSendMessage(msg); + } + + // Get current gamepad state + for (int i = 0; i < MAX_GAMEPADS; i++) + { + if (IsGamepadAvailable(i)) + { + // Get current gamepad state + auto gamepad = Gamepad::Gamepads->GetAt(i); + GamepadReading reading = gamepad->GetCurrentReading(); + + // NOTE: Maybe it would be wiser to redefine the gamepad button mappings in "raylib.h" for the UWP platform instead of remapping them manually + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_A, ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_B, ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_X, ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_Y, ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_LB, ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_RB, ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_SELECT, ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View)); // Changed for XB1 Controller + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_START, ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu)); // Changed for XB1 Controller + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_UP, ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_RIGHT, ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_DOWN, ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadDown)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_LEFT, ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadLeft)); + RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_HOME, false); // Home button not supported by UWP + + // Get current axis state + RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_LEFT_X, (float)reading.LeftThumbstickX); + RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_LEFT_Y, (float)reading.LeftThumbstickY); + RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_RIGHT_X, (float)reading.RightThumbstickX); + RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_RIGHT_Y, (float)reading.RightThumbstickY); + RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_LT, (float)reading.LeftTrigger); + RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_RT, (float)reading.RightTrigger); + } + } + } + } + + // Application lifecycle event handlers. + void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args) + { + // Run() won't start until the CoreWindow is activated. + CoreWindow::GetForCurrentThread()->Activate(); + } + + void OnResuming(Platform::Object^ sender, Platform::Object^ args) {} + + // Window event handlers. + void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = HandleResize; + UWPSendMessage(msg); + } + + void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args) + { + mWindowVisible = args->Visible; + } + + void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args) + { + mWindowClosed = true; + } + + // DisplayInformation event handlers. + void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args) {} + void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args) {} + + // Input event handlers + void PointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args) + { + //Get the current active pointer ID for our loop + CurrentPointerID = args->CurrentPoint->PointerId; + args->Handled = true; + } + + void PointerWheelChanged(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = ScrollWheelUpdate; + msg->Float0 = args->CurrentPoint->Properties->MouseWheelDelta; + UWPSendMessage(msg); + } + + void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args) + { + mouseDelta.x += args->MouseDelta.X; + mouseDelta.y += args->MouseDelta.Y; + } + + void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) + { +#ifdef HOLDHACK + //Start the hack + KeyboardStateHack[(int)args->VirtualKey] = 1; +#endif + + RegisterKey((int)args->VirtualKey, 1); + } + + void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) + { +#ifdef HOLDHACK + //The same hack + if (KeyboardStateHack[(int)args->VirtualKey] == 1) + { + KeyboardStateHack[(int)args->VirtualKey] = 2; + } + else if (KeyboardStateHack[(int)args->VirtualKey] == 2) + { + KeyboardStateHack[(int)args->VirtualKey] = 3; + } + else if (KeyboardStateHack[(int)args->VirtualKey] == 3) + { + KeyboardStateHack[(int)args->VirtualKey] = 4; + } + else if (KeyboardStateHack[(int)args->VirtualKey] == 4) + { + RegisterKey((int)args->VirtualKey, 0); + KeyboardStateHack[(int)args->VirtualKey] = 0; + } +#else + //No hack, allow flickers + RegisterKey((int)args->VirtualKey, 0); +#endif + } + +private: + + void RegisterKey(int key, char status) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = UWPMessageType::RegisterKey; + msg->Int0 = key; + msg->Char0 = status; + UWPSendMessage(msg); + } + + void MoveMouse(Vector2 pos) + { + CoreWindow ^window = CoreWindow::GetForCurrentThread(); + Point mousePosScreen = Point(pos.x + window->Bounds.X, pos.y + window->Bounds.Y); + window->PointerPosition = mousePosScreen; + } + + void RegisterGamepadButton(int gamepad, int button, char status) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = MarkGamepadButton; + msg->Int0 = gamepad; + msg->Int1 = button; + msg->Char0 = status; + UWPSendMessage(msg); + } + + void RegisterGamepadAxis(int gamepad, int axis, float value) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = MarkGamepadAxis; + msg->Int0 = gamepad; + msg->Int1 = axis; + msg->Float0 = value; + UWPSendMessage(msg); + } + + void UpdateMousePosition(Vector2 pos) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = UpdateMouseLocation; + msg->Vector0 = pos; + UWPSendMessage(msg); + } + + void RegisterClick(int button, char status) + { + UWPMessage* msg = CreateUWPMessage(); + msg->Type = UWPMessageType::RegisterClick; + msg->Int0 = button; + msg->Char0 = status; + UWPSendMessage(msg); + } + + bool mWindowClosed = false; + bool mWindowVisible = true; + + int width = 640; + int height = 480; + + int CurrentPointerID = -1; + +#ifdef HOLDHACK + char KeyboardStateHack[0xA6]; //0xA6 because the highest key we compare against is 0xA5 +#endif +}; + +//Application source for creating the program +template +ref class ApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource +{ +public: + virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView() + { + return ref new AppType(); + } +}; \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/Package.appxmanifest b/projects/VS2017.UWP/raylib.App.UWP/Package.appxmanifest new file mode 100644 index 00000000..56020a50 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/Package.appxmanifest @@ -0,0 +1,26 @@ + + + + + + raylibUWP + raysan5 + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/packages.config b/projects/VS2017.UWP/raylib.App.UWP/packages.config new file mode 100644 index 00000000..70c3dea0 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/pch.cpp b/projects/VS2017.UWP/raylib.App.UWP/pch.cpp new file mode 100644 index 00000000..bcb5590b --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/projects/VS2017.UWP/raylib.App.UWP/pch.h b/projects/VS2017.UWP/raylib.App.UWP/pch.h new file mode 100644 index 00000000..dcbd2378 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/pch.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include + +// OpenGL ES includes +#include +#include + +// EGL includes +#include +#include +#include + +// ANGLE include for Windows Store +#include \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx new file mode 100644 index 00000000..0ada3be0 Binary files /dev/null and b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.TemporaryKey.pfx differ diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.filters b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.filters new file mode 100644 index 00000000..4e83c979 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.filters @@ -0,0 +1,42 @@ + + + + + + + + + + + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + + + + + + + + + + + + {d16954bb-de54-472b-ac10-ecab10d3fdc8} + + + \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj new file mode 100644 index 00000000..421d7209 --- /dev/null +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM + + + Release + ARM + + + + {b842558c-c034-4e4b-9457-a286f26e83cc} + raylibUWP + en-US + 14.0 + true + Windows Store + 10.0.17763.0 + 10.0.17763.0 + 10.0 + raylib.App.UWP + + + + Application + true + v141 + + + Application + false + true + v140 + + + + + + + + raylib.App.UWP.TemporaryKey.pfx + + + $(IncludePath) + $(LibraryPath) + + + + mincore.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\arm;$(VCInstallDir)\lib\arm;$(SolutionDir)\raylib\Debug + + + + + mincore.lib;%(AdditionalDependencies) + $(SolutionDir)raylib\Debug;%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib + + + + + mincore.lib;%(AdditionalDependencies) + C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\x64\Debug;C:\Users\Alumno\Downloads\angle\UWP_OpenGLES2\raylib;%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64 + + + + + pch.h + $(IntDir)pch.pch + $(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + 4453;28204 + PLATFORM_UWP;_DEBUG;%(PreprocessorDefinitions) + + + true + + + + + pch.h + $(IntDir)pch.pch + $(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories) + /bigobj %(AdditionalOptions) + 4453;28204 + PLATFORM_UWP;NDEBUG;%(PreprocessorDefinitions) + Default + false + + + /NODEFAULTLIB %(AdditionalOptions) + + + + + + + + + + + + + + + + + + Create + + + + + Designer + + + + + + + {ea91e088-7c71-4f32-b761-e054305cd519} + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.UWP.sln b/projects/VS2017.UWP/raylib.UWP.sln new file mode 100644 index 00000000..fb528655 --- /dev/null +++ b/projects/VS2017.UWP/raylib.UWP.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.438 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib.App.UWP", "raylib.App.UWP\raylib.App.UWP.vcxproj", "{B842558C-C034-4E4B-9457-A286F26E83CC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib.UWP", "raylib.UWP\raylib.UWP.vcxproj", "{EA91E088-7C71-4F32-B761-E054305CD519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.ActiveCfg = Debug|ARM + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Build.0 = Debug|ARM + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Deploy.0 = Debug|ARM + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.ActiveCfg = Debug|x64 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Build.0 = Debug|x64 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Deploy.0 = Debug|x64 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.ActiveCfg = Debug|Win32 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Build.0 = Debug|Win32 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Deploy.0 = Debug|Win32 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.ActiveCfg = Release|ARM + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Build.0 = Release|ARM + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Deploy.0 = Release|ARM + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.ActiveCfg = Release|x64 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Build.0 = Release|x64 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Deploy.0 = Release|x64 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.ActiveCfg = Release|Win32 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Build.0 = Release|Win32 + {B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Deploy.0 = Release|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|ARM.ActiveCfg = Debug|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|ARM.Build.0 = Debug|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x64.ActiveCfg = Debug|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x64.Build.0 = Debug|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x86.ActiveCfg = Debug|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Debug|x86.Build.0 = Debug|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|ARM.ActiveCfg = Release|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|ARM.Build.0 = Release|ARM + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x64.ActiveCfg = Release|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x64.Build.0 = Release|x64 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x86.ActiveCfg = Release|Win32 + {EA91E088-7C71-4F32-B761-E054305CD519}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E32C7998-071A-419B-8869-E957374307CA} + EndGlobalSection +EndGlobal diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj new file mode 100644 index 00000000..f05f829c --- /dev/null +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {ea91e088-7c71-4f32-b761-e054305cd519} + StaticLibrary + raylib_UWP + en-US + 14.0 + true + Windows Store + 10.0.17763.0 + 10.0.15063.0 + 10.0 + + + + StaticLibrary + true + v141 + + + StaticLibrary + true + v141 + + + StaticLibrary + true + v141 + + + StaticLibrary + false + true + v141 + + + StaticLibrary + false + true + v141 + + + StaticLibrary + false + true + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + false + + + + NotUsing + false + true + _CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + + + Console + false + false + + + + + NotUsing + false + true + _CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + + + Console + false + false + + + + + NotUsing + false + true + _CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + + + Console + false + false + + + + + NotUsing + false + true + _CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + + + Console + false + false + + + + + NotUsing + false + true + _CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + + + Console + false + false + + + + + NotUsing + false + true + _CRT_SECURE_NO_WARNINGS;GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP;_UNICODE;UNICODE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + + + Console + false + false + + + + + + \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters new file mode 100644 index 00000000..cbad7c9b --- /dev/null +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj.filters @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From b911cefab3f39506e22d517088cc9869f363e897 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Sat, 27 Apr 2019 20:49:33 +0100 Subject: First gamepad stuff --- projects/VS2017/examples/core_basic_window_cpp.vcxproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'projects') diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index cfe08524..bc8221a5 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -166,14 +166,15 @@ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + true - - - -- cgit v1.2.3 From 56ded3259ded9c5fc8d5c7dff1a50044326f5ab5 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Sat, 27 Apr 2019 21:36:57 +0100 Subject: More work, UWP now supports it and deleted old gamepads --- projects/VS2017.UWP/raylib.App.UWP/App.cpp | 6 ++-- projects/VS2017.UWP/raylib.App.UWP/BaseApp.h | 41 ++++++++++++---------- .../VS2017/examples/core_basic_window_cpp.vcxproj | 7 ++-- 3 files changed, 28 insertions(+), 26 deletions(-) (limited to 'projects') diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp index ae137ed2..fb07636c 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -36,8 +36,8 @@ void App::Update() ClearBackground(RAYWHITE); - posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X) * 5; - posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y) * -5; + posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_Y) * -5; DrawRectangle(posX, posY, 400, 100, RED); @@ -63,7 +63,7 @@ void App::Update() if (IsKeyDown(KEY_LEFT_ALT)) DrawRectangle(250, 250, 20, 20, BLACK); - if (IsKeyDown(KEY_BACKSPACE)) + if (IsKeyDown(KEY_BACKSPACE) || IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) DrawRectangle(280, 250, 20, 20, BLACK); if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK); diff --git a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h index e27909e2..65483754 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h +++ b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h @@ -371,27 +371,30 @@ protected: GamepadReading reading = gamepad->GetCurrentReading(); // NOTE: Maybe it would be wiser to redefine the gamepad button mappings in "raylib.h" for the UWP platform instead of remapping them manually - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_A, ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_B, ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_X, ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_Y, ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_LB, ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_RB, ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_SELECT, ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View)); // Changed for XB1 Controller - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_START, ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu)); // Changed for XB1 Controller - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_UP, ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_RIGHT, ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_DOWN, ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadDown)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_LEFT, ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadLeft)); - RegisterGamepadButton(i, GAMEPAD_XBOX_BUTTON_HOME, false); // Home button not supported by UWP + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_DOWN, ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_LEFT, ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_FACE_UP, ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y)); + + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_TRIGGER_1, ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_RIGHT_TRIGGER_1, ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder)); + + RegisterGamepadButton(i, GAMEPAD_BUTTON_MIDDLE_LEFT, ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View)); // Changed for XB1 Controller + RegisterGamepadButton(i, GAMEPAD_BUTTON_MIDDLE_RIGHT, ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu)); // Changed for XB1 Controller + + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_UP, ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_RIGHT, ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_DOWN, ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadDown)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_LEFT_FACE_LEFT, ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadLeft)); + RegisterGamepadButton(i, GAMEPAD_BUTTON_MIDDLE, false); // Home button not supported by UWP // Get current axis state - RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_LEFT_X, (float)reading.LeftThumbstickX); - RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_LEFT_Y, (float)reading.LeftThumbstickY); - RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_RIGHT_X, (float)reading.RightThumbstickX); - RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_RIGHT_Y, (float)reading.RightThumbstickY); - RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_LT, (float)reading.LeftTrigger); - RegisterGamepadAxis(i, GAMEPAD_XBOX_AXIS_RT, (float)reading.RightTrigger); + RegisterGamepadAxis(i, GAMEPAD_AXIS_LEFT_X, (float)reading.LeftThumbstickX); + RegisterGamepadAxis(i, GAMEPAD_AXIS_LEFT_Y, (float)reading.LeftThumbstickY); + RegisterGamepadAxis(i, GAMEPAD_AXIS_RIGHT_X, (float)reading.RightThumbstickX); + RegisterGamepadAxis(i, GAMEPAD_AXIS_RIGHT_Y, (float)reading.RightThumbstickY); + RegisterGamepadAxis(i, GAMEPAD_AXIS_LEFT_TRIGGER, (float)reading.LeftTrigger); + RegisterGamepadAxis(i, GAMEPAD_AXIS_RIGHT_TRIGGER, (float)reading.RightTrigger); } } } diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index bc8221a5..cfe08524 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -166,15 +166,14 @@ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - {e89d61ac-55de-4482-afd4-df7242ebc859} - true + + + -- cgit v1.2.3 From e8c413b7cd1696c207d015bc3e4a00edf71300d2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 27 Apr 2019 22:47:03 +0200 Subject: Review UWP implementation Basically, formating review and some variables naming to follow raylib conventions. --- projects/VS2017.UWP/raylib.App.UWP/App.cpp | 61 +++++++------- projects/VS2017.UWP/raylib.App.UWP/App.h | 4 +- projects/VS2017.UWP/raylib.App.UWP/BaseApp.h | 118 +++++++++++++-------------- 3 files changed, 92 insertions(+), 91 deletions(-) (limited to 'projects') diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp index ae137ed2..82e5b12e 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -17,7 +17,7 @@ int main(Platform::Array^) App::App() { - //This does not work... need to fix this. + // This does not work... need to fix this. SetConfigFlags(0); Setup(640, 480); @@ -30,49 +30,50 @@ static int gTime = 0; // This method is called every frame void App::Update() { - //return; - // Draw + // Update + //---------------------------------------------------------------------------------- + posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y) * -5; + + auto mPos = GetMousePosition(); + + if (IsKeyPressed(KEY_A)) + { + posX -= 50; + EnableCursor(); + } + + if (IsKeyPressed(KEY_D)) + { + posX += 50; + DisableCursor(); + } + + static int pos = 0; + pos -= GetMouseWheelMove(); + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); - - posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X) * 5; - posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y) * -5; DrawRectangle(posX, posY, 400, 100, RED); DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); - auto mPos = GetMousePosition(); - DrawCircle(mPos.x, mPos.y, 40, BLUE); if (IsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); - if (IsKeyPressed(KEY_A)) - { - posX -= 50; - EnableCursor(); - } - - if (IsKeyPressed(KEY_D)) - { - posX += 50; - DisableCursor(); - } - - if (IsKeyDown(KEY_LEFT_ALT)) - DrawRectangle(250, 250, 20, 20, BLACK); - if (IsKeyDown(KEY_BACKSPACE)) - DrawRectangle(280, 250, 20, 20, BLACK); - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - DrawRectangle(280, 250, 20, 20, BLACK); - - static int pos = 0; - pos -= GetMouseWheelMove(); - + if (IsKeyDown(KEY_LEFT_ALT)) DrawRectangle(250, 250, 20, 20, BLACK); + if (IsKeyDown(KEY_BACKSPACE)) DrawRectangle(280, 250, 20, 20, BLACK); + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK); + DrawRectangle(280, pos + 50, 20, 20, BLACK); DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE); EndDrawing(); + //---------------------------------------------------------------------------------- } \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.h b/projects/VS2017.UWP/raylib.App.UWP/App.h index 26c1d400..fa33237d 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.h +++ b/projects/VS2017.UWP/raylib.App.UWP/App.h @@ -4,10 +4,10 @@ #include "pch.h" -//Define what header we use for BaseApp.h +// Define what header we use for BaseApp.h #define PCH "pch.h" -//Enable hold hack +// Enable hold hack #define HOLDHACK #include "BaseApp.h" diff --git a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h index e27909e2..74434a75 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h +++ b/projects/VS2017.UWP/raylib.App.UWP/BaseApp.h @@ -126,44 +126,43 @@ public: void Setup(int width, int height) { - //Set dimensions + // Set dimensions this->width = width; this->height = height; } virtual void Run() { - //Get display dimensions + // Get display dimensions DisplayInformation^ dInfo = DisplayInformation::GetForCurrentView(); Vector2 screenSize = { dInfo->ScreenWidthInRawPixels, dInfo->ScreenHeightInRawPixels }; - //Send display dimensions - UWPMessage* msg = CreateUWPMessage(); - msg->Type = SetDisplayDims; - msg->Vector0 = screenSize; + // Send display dimensions + UWPMessage *msg = CreateUWPMessage(); + msg->type = UWP_MSG_SET_DISPLAY_DIMS; + msg->paramVector0 = screenSize; UWPSendMessage(msg); - //Send the time to the core + // Send the time to the core using clock = std::chrono::high_resolution_clock; auto timeStart = clock::now(); - //Set fps if 0 - if (GetFPS() <= 0) - SetTargetFPS(60); + // Set fps if 0 + if (GetFPS() <= 0) SetTargetFPS(60); while (!mWindowClosed) { if (mWindowVisible) { - //Send time + // Send time auto delta = clock::now() - timeStart; - UWPMessage* timeMsg = CreateUWPMessage(); - timeMsg->Type = SetGameTime; - timeMsg->Double0 = std::chrono::duration_cast(delta).count(); + UWPMessage *timeMsg = CreateUWPMessage(); + timeMsg->type = UWP_MSG_SET_GAME_TIME; + timeMsg->paramDouble0 = std::chrono::duration_cast(delta).count(); UWPSendMessage(timeMsg); - //Call update function + // Call update function Update(); PollInput(); @@ -191,38 +190,38 @@ protected: { // Process Messages { - //Loop over pending messages + // Loop over pending messages while (UWPHasMessages()) { - //Get the message + // Get the message auto msg = UWPGetMessage(); - //Carry out the command - switch(msg->Type) + // Carry out the command + switch(msg->type) { - case ShowMouse: //Do the same thing because of how UWP works... - case UnlockMouse: + case UWP_MSG_SHOW_MOUSE: // Do the same thing because of how UWP works... + case UWP_MSG_UNLOCK_MOUSE: { CoreWindow::GetForCurrentThread()->PointerCursor = regularCursor; cursorLocked = false; MoveMouse(GetMousePosition()); break; } - case HideMouse: //Do the same thing because of how UWP works... - case LockMouse: + case UWP_MSG_HIDE_MOUSE: // Do the same thing because of how UWP works... + case UWP_MSG_LOCK_MOUSE: { CoreWindow::GetForCurrentThread()->PointerCursor = nullptr; cursorLocked = true; break; } - case SetMouseLocation: + case UWP_MSG_SET_MOUSE_LOCATION: { - MoveMouse(msg->Vector0); + MoveMouse(msg->paramVector0); break; } } - //Delete the message + // Delete the message DeleteUWPMessage(msg); } } @@ -233,8 +232,8 @@ protected: auto state = CoreWindow::GetForCurrentThread()->GetKeyState((Windows::System::VirtualKey) k); #ifdef HOLDHACK - //Super hacky way of waiting three frames to see if we are ready to register the key as deregistered - //This will wait an entire 4 frames before deregistering the key, this makes sure that the key is not flickering + // Super hacky way of waiting three frames to see if we are ready to register the key as deregistered + // This will wait an entire 4 frames before deregistering the key, this makes sure that the key is not flickering if (KeyboardStateHack[k] == 2) { if ((state & CoreVirtualKeyStates::None) == CoreVirtualKeyStates::None) @@ -261,10 +260,10 @@ protected: } } #endif - //Left and right alt, KeyUp and KeyDown are not called for it - //No need to hack because this is not a character + // Left and right alt, KeyUp and KeyDown are not called for it + // No need to hack because this is not a character - //TODO: Maybe do all other key registrations like this, no more key events? + // TODO: Maybe do all other key registrations like this, no more key events? if (k == 0xA4 || k == 0xA5) { @@ -283,7 +282,8 @@ protected: // Process Mouse { - if (CurrentPointerID > -1) { + if (CurrentPointerID > -1) + { auto point = PointerPoint::GetCurrentPoint(CurrentPointerID); auto props = point->Properties; @@ -355,9 +355,9 @@ protected: // e.g. player 1, 2, and 3 are playing a game - if player2 disconnects, p3's controller would now be mapped to p2's character since p3 is now second in the list. UWPMessage* msg = CreateUWPMessage(); - msg->Type = MarkGamepadActive; - msg->Int0 = i; - msg->Bool0 = i < Gamepad::Gamepads->Size; + msg->type = UWP_MSG_SET_GAMEPAD_ACTIVE; + msg->paramInt0 = i; + msg->paramBool0 = i < Gamepad::Gamepads->Size; UWPSendMessage(msg); } @@ -410,7 +410,7 @@ protected: void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = HandleResize; + msg->type = UWP_MSG_HANDLE_RESIZE; UWPSendMessage(msg); } @@ -439,8 +439,8 @@ protected: void PointerWheelChanged(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = ScrollWheelUpdate; - msg->Float0 = args->CurrentPoint->Properties->MouseWheelDelta; + msg->type = UWP_MSG_SCROLL_WHEEL_UPDATE; + msg->paramFloat0 = args->CurrentPoint->Properties->MouseWheelDelta; UWPSendMessage(msg); } @@ -453,7 +453,7 @@ protected: void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) { #ifdef HOLDHACK - //Start the hack + // Start the hack KeyboardStateHack[(int)args->VirtualKey] = 1; #endif @@ -463,7 +463,7 @@ protected: void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) { #ifdef HOLDHACK - //The same hack + // The same hack if (KeyboardStateHack[(int)args->VirtualKey] == 1) { KeyboardStateHack[(int)args->VirtualKey] = 2; @@ -482,7 +482,7 @@ protected: KeyboardStateHack[(int)args->VirtualKey] = 0; } #else - //No hack, allow flickers + // No hack, allow flickers RegisterKey((int)args->VirtualKey, 0); #endif } @@ -492,9 +492,9 @@ private: void RegisterKey(int key, char status) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = UWPMessageType::RegisterKey; - msg->Int0 = key; - msg->Char0 = status; + msg->type = UWPMessageType::UWP_MSG_REGISTER_KEY; + msg->paramInt0 = key; + msg->paramChar0 = status; UWPSendMessage(msg); } @@ -508,37 +508,37 @@ private: void RegisterGamepadButton(int gamepad, int button, char status) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = MarkGamepadButton; - msg->Int0 = gamepad; - msg->Int1 = button; - msg->Char0 = status; + msg->type = UWP_MSG_SET_GAMEPAD_BUTTON; + msg->paramInt0 = gamepad; + msg->paramInt1 = button; + msg->paramChar0 = status; UWPSendMessage(msg); } void RegisterGamepadAxis(int gamepad, int axis, float value) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = MarkGamepadAxis; - msg->Int0 = gamepad; - msg->Int1 = axis; - msg->Float0 = value; + msg->type = UWP_MSG_SET_GAMEPAD_AXIS; + msg->paramInt0 = gamepad; + msg->paramInt1 = axis; + msg->paramFloat0 = value; UWPSendMessage(msg); } void UpdateMousePosition(Vector2 pos) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = UpdateMouseLocation; - msg->Vector0 = pos; + msg->type = UWP_MSG_UPDATE_MOUSE_LOCATION; + msg->paramVector0 = pos; UWPSendMessage(msg); } void RegisterClick(int button, char status) { UWPMessage* msg = CreateUWPMessage(); - msg->Type = UWPMessageType::RegisterClick; - msg->Int0 = button; - msg->Char0 = status; + msg->type = UWPMessageType::UWP_MSG_REGISTER_CLICK; + msg->paramInt0 = button; + msg->paramChar0 = status; UWPSendMessage(msg); } @@ -551,11 +551,11 @@ private: int CurrentPointerID = -1; #ifdef HOLDHACK - char KeyboardStateHack[0xA6]; //0xA6 because the highest key we compare against is 0xA5 + char KeyboardStateHack[0xA6]; // 0xA6 because the highest key we compare against is 0xA5 #endif }; -//Application source for creating the program +// Application source for creating the program template ref class ApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource { -- cgit v1.2.3 From 561c486ceb2d1563fbcd0bec60a1f1d9e94cb7c0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 10 May 2019 20:51:48 +0200 Subject: Add WinMM library for linkage Now it's required on Windows if not using a busy wait loop --- projects/4coder/Makefile | 2 +- projects/CodeBlocks/core_basic_window.cbp | 2 +- projects/Geany/raylib_compile_execute.bat | 2 +- projects/Notepad++/npes_saved_tcc.txt | Bin 7450 -> 7466 bytes projects/VS2015/examples/core_basic_window.vcxproj | 30 +++------ .../VS2015/examples/core_basic_window_cpp.vcxproj | 25 +++---- projects/VS2015/raylib.sln | 6 +- projects/VS2015/raylib/raylib.vcxproj | 73 +-------------------- .../raylib.App.UWP/raylib.App.UWP.vcxproj | 4 +- projects/VS2017/examples/core_basic_window.vcxproj | 8 +-- .../VS2017/examples/core_basic_window_cpp.vcxproj | 8 +-- 11 files changed, 34 insertions(+), 126 deletions(-) (limited to 'projects') diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 3cffaaba..55c8a462 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -235,7 +235,7 @@ endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation - LDLIBS = -lraylib -lopengl32 -lgdi32 + LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm # Required for physac examples #LDLIBS += -static -lpthread diff --git a/projects/CodeBlocks/core_basic_window.cbp b/projects/CodeBlocks/core_basic_window.cbp index 10390e25..0000860f 100644 --- a/projects/CodeBlocks/core_basic_window.cbp +++ b/projects/CodeBlocks/core_basic_window.cbp @@ -31,7 +31,7 @@ - + diff --git a/projects/Geany/raylib_compile_execute.bat b/projects/Geany/raylib_compile_execute.bat index a62a1aca..eeba0b05 100644 --- a/projects/Geany/raylib_compile_execute.bat +++ b/projects/Geany/raylib_compile_execute.bat @@ -13,7 +13,7 @@ cmd /c if exist %NAME_PART%.exe del /F %NAME_PART%.exe :: . :: > Compiling program :: -------------------------- -gcc -o %NAME_PART%.exe %FILE_NAME% %RAYLIB_DIR%\raylib.rc.data -s -O2 -I../../src -Iexternal -lraylib -lopengl32 -lgdi32 -std=c99 -Wall -mwindows +gcc -o %NAME_PART%.exe %FILE_NAME% %RAYLIB_DIR%\raylib.rc.data -s -O2 -I../../src -Iexternal -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 -Wall -mwindows :: . :: . > Executing program :: ------------------------- diff --git a/projects/Notepad++/npes_saved_tcc.txt b/projects/Notepad++/npes_saved_tcc.txt index 419e4af6..82f88aaf 100644 Binary files a/projects/Notepad++/npes_saved_tcc.txt and b/projects/Notepad++/npes_saved_tcc.txt differ diff --git a/projects/VS2015/examples/core_basic_window.vcxproj b/projects/VS2015/examples/core_basic_window.vcxproj index dd964a97..ee01c79d 100644 --- a/projects/VS2015/examples/core_basic_window.vcxproj +++ b/projects/VS2015/examples/core_basic_window.vcxproj @@ -5,10 +5,6 @@ Debug.DLL Win32 - - Debug.UWP - Win32 - Debug Win32 @@ -26,7 +22,7 @@ {0981CA98-E4A5-4DF1-987F-A41D09131EFC} Win32Proj core_basic_window - 10.0.16299.0 + 10.0.17763.0 core_basic_window @@ -56,9 +52,6 @@ true Unicode - - v140 - @@ -105,13 +98,13 @@ Disabled WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) Console true %(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -122,13 +115,13 @@ Disabled WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) Console true %(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -140,7 +133,7 @@ true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -149,7 +142,7 @@ true true true - kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) @@ -162,7 +155,7 @@ true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -171,12 +164,7 @@ true true true - kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - %(AdditionalLibraryDirectories) - - - - + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;opengl32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) diff --git a/projects/VS2015/examples/core_basic_window_cpp.vcxproj b/projects/VS2015/examples/core_basic_window_cpp.vcxproj index 2ec74bc4..89504224 100644 --- a/projects/VS2015/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2015/examples/core_basic_window_cpp.vcxproj @@ -5,10 +5,6 @@ Debug.DLL Win32 - - Debug.UWP - Win32 - Debug Win32 @@ -26,7 +22,7 @@ {B655E850-3322-42F7-941D-6AC18FD66CA1} Win32Proj raylib_example_cpp - 10.0.16299.0 + 10.0.17763.0 core_basic_window_cpp @@ -56,9 +52,6 @@ true Unicode - - v140 - @@ -104,13 +97,13 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsCpp Console true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) @@ -121,13 +114,13 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsCpp Console true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) @@ -141,7 +134,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) CompileAsCpp - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) Console @@ -149,7 +142,7 @@ true true $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -162,7 +155,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) CompileAsCpp - $(SolutionDir)..\..\release\include;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) Console @@ -170,7 +163,7 @@ true true $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/projects/VS2015/raylib.sln b/projects/VS2015/raylib.sln index f8ddf5cd..b0742574 100644 --- a/projects/VS2015/raylib.sln +++ b/projects/VS2015/raylib.sln @@ -35,15 +35,13 @@ Global {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|Win32 {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.ActiveCfg = Debug.UWP|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.Build.0 = Debug.UWP|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x64.ActiveCfg = Debug.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.ActiveCfg = Debug|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.ActiveCfg = Debug|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.Build.0 = Debug|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.ActiveCfg = Debug.UWP|Win32 - {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.Build.0 = Debug.UWP|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x64.ActiveCfg = Release.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.Build.0 = Release.DLL|Win32 {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.ActiveCfg = Release|Win32 diff --git a/projects/VS2015/raylib/raylib.vcxproj b/projects/VS2015/raylib/raylib.vcxproj index 6722ed07..0b3527cb 100644 --- a/projects/VS2015/raylib/raylib.vcxproj +++ b/projects/VS2015/raylib/raylib.vcxproj @@ -5,10 +5,6 @@ Debug.DLL Win32 - - Debug.UWP - Win32 - Debug Win32 @@ -17,10 +13,6 @@ Release.DLL Win32 - - Release.UWP - Win32 - Release Win32 @@ -30,7 +22,7 @@ {E89D61AC-55DE-4482-AFD4-DF7242EBC859} Win32Proj raylib - 10.0.16299.0 + 10.0.17763.0 @@ -39,12 +31,6 @@ v140 Unicode - - StaticLibrary - true - v140 - Unicode - DynamicLibrary true @@ -58,13 +44,6 @@ true Unicode - - StaticLibrary - false - v140 - true - Unicode - DynamicLibrary false @@ -80,18 +59,12 @@ - - - - - - @@ -99,9 +72,6 @@ $(SolutionDir)$(ProjectName)\$(Configuration)\ - - $(SolutionDir)$(ProjectName)\$(Configuration)\ - $(SolutionDir)$(ProjectName)\$(Configuration)\ @@ -109,10 +79,6 @@ $(SolutionDir)$(ProjectName)\$(Configuration)\ $(SolutionDir)$(ProjectName)\$(Configuration)\temp - - $(SolutionDir)$(ProjectName)\$(Configuration)\ - $(SolutionDir)$(ProjectName)\$(Configuration)\temp - $(SolutionDir)$(ProjectName)\$(Configuration)\ $(SolutionDir)$(ProjectName)\$(Configuration)\temp @@ -135,24 +101,6 @@ %(AdditionalLibraryDirectories) - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP - CompileAsC - $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\ANGLE - MultiThreadedDebug - - - Windows - - - %(AdditionalLibraryDirectories) - - @@ -190,25 +138,6 @@ true - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP - $(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include - CompileAsC - MultiThreaded - - - Windows - true - true - - Level3 diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj index 421d7209..fe97faac 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj @@ -76,8 +76,8 @@ - mincore.lib;%(AdditionalDependencies) - C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\x64\Debug;C:\Users\Alumno\Downloads\angle\UWP_OpenGLES2\raylib;%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64 + mincore.lib;winmm.lib;%(AdditionalDependencies) + $(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64;%(AdditionalLibraryDirectories) diff --git a/projects/VS2017/examples/core_basic_window.vcxproj b/projects/VS2017/examples/core_basic_window.vcxproj index 87bef8d8..0348589f 100644 --- a/projects/VS2017/examples/core_basic_window.vcxproj +++ b/projects/VS2017/examples/core_basic_window.vcxproj @@ -104,7 +104,7 @@ Console true %(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -121,7 +121,7 @@ Console true %(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -142,7 +142,7 @@ true true true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) @@ -164,7 +164,7 @@ true true true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index cfe08524..6ade272d 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -103,7 +103,7 @@ Console true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) @@ -120,7 +120,7 @@ Console true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) @@ -142,7 +142,7 @@ true true $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -163,7 +163,7 @@ true true %(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) -- cgit v1.2.3 From 0027868d1f4ba76043e1cdfbb5c172696ad0985b Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 May 2019 17:46:52 +0200 Subject: Review Makefiles --- projects/4coder/Makefile | 196 ++++++++++++++++++++++++-------------- projects/4coder/Makefile.Android | 36 +++---- projects/VSCode/Makefile | 198 +++++++++++++++++++++++++-------------- projects/VSCode/Makefile.Android | 36 +++---- 4 files changed, 291 insertions(+), 175 deletions(-) (limited to 'projects') diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 55c8a462..c7b9162a 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -24,29 +24,43 @@ .PHONY: all clean # Define required raylib variables -# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop() -PLATFORM ?= PLATFORM_DESKTOP -RAYLIB_PATH ?= ../.. -PROJECT_NAME ?= game -DEBUGGING ?= FALSE - -# Default path for raylib on Raspberry Pi, if installed in different path, update it! -ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_PATH ?= /home/pi/raylib -endif +PROJECT_NAME ?= game +RAYLIB_VERSION ?= 2.5.0 +RAYLIB_API_VERSION ?= 2 +RAYLIB_PATH ?= C:\GitHub\raylib + +# Define default options + +# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB +PLATFORM ?= PLATFORM_DESKTOP + +# Locations of your newly installed library and associated headers. See ../src/Makefile +# On Linux, if you have installed raylib but cannot compile the examples, check that +# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations. +# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED. +# To enable compile-time linking to a special version of libraylib.so, change these variables here. +# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below. +# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime, +# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH. +# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. +DESTDIR ?= /usr/local +RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib +# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. +RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC + +# Build mode for project: DEBUG or RELEASE +BUILD_MODE ?= RELEASE # Use external GLFW library instead of rglfw module -USE_EXTERNAL_GLFW ?= FALSE +# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3 +USE_EXTERNAL_GLFW ?= FALSE # Use Wayland display server protocol on Linux desktop # by default it uses X11 windowing system -USE_WAYLAND_DISPLAY ?= FALSE - -# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile) - +USE_WAYLAND_DISPLAY ?= FALSE # Determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -54,7 +68,6 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) PLATFORM_OS=WINDOWS - export PATH := C:/raylib/mingw32/bin:$(PATH) else UNAMEOS=$(shell uname) ifeq ($(UNAMEOS),Linux) @@ -84,41 +97,51 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif endif -ifeq ($(PLATFORM),PLATFORM_WEB) - # Emscripten required variables - EMSDK_PATH = C:/emsdk - EMSCRIPTEN_VERSION = 1.38.8 - CLANG_VERSION = e1.38.8_64bit - PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 - NODE_VERSION = 8.9.1_64bit - export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) - EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) -endif - -RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs - -# Define raylib release directory for compiled library +# RAYLIB_PATH adjustment for different platforms. +# If using GNU make, we can get the full path to the top of the tree. Windows? BSD? +# Required for ldconfig or other tools that do not perform path expansion. ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32 - endif ifeq ($(PLATFORM_OS),LINUX) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux - endif - ifeq ($(PLATFORM_OS),OSX) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx - endif - ifeq ($(PLATFORM_OS),BSD) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd + RAYLIB_PREFIX ?= .. + RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX)) endif endif +# Default path for raylib on Raspberry Pi, if installed in different path, update it! +# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki. +# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX. ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi + RAYLIB_PATH ?= /home/pi/raylib endif + ifeq ($(PLATFORM),PLATFORM_WEB) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5 + # Emscripten required variables + EMSDK_PATH ?= C:/emsdk + EMSCRIPTEN_VERSION ?= 1.38.31 + CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit + PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 + NODE_VERSION = 8.9.1_64bit + export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) + EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) endif +# Define raylib release directory for compiled library. +# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src + +# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries +# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH +# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux +# without formal installation from ../src/Makefile. It aids portability and is useful if you have +# multiple versions of raylib, have raylib installed to a non-standard location, or want to +# bundle libraylib.so with your game. Change it to your liking. +# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, +# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH, +# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) +# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute. +# To see which libraries a built example is linking to, ldd core/core_basic_window; +# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing. +EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH) + # Define default C compiler: gcc # NOTE: define g++ compiler if using C++ CC = gcc @@ -142,6 +165,8 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif ifeq ($(PLATFORM),PLATFORM_WEB) # HTML5 emscripten compiler + # WARNING: To compile to HTML5, code must be redesigned + # to use emscripten.h and emscripten_set_main_loop() CC = emcc endif @@ -152,53 +177,64 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) MAKE = make endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make - endif endif # Define compiler flags: # -O1 defines optimization level -# -g enable debugging +# -g include debug information on compilation # -s strip unnecessary data from build # -Wall turns on most, but not all, compiler warnings # -std=c99 defines C language mode (standard C from 1999 revision) # -std=gnu99 defines C language mode (GNU C from 1999 revision) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec -ifeq ($(DEBUGGING), TRUE) +CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces + +ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -else - CFLAGS += -O1 -s endif -CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces # Additional flags for compiler (if desired) #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) - # resources file contains windows exe icon + # resource file contains windows executable icon and properties # -Wl,--subsystem,windows hides the console window - CFLAGS += -Wl,--subsystem,windows - LDFLAGS += $(RAYLIB_PATH)/raylib.rc.data + CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -D_DEFAULT_SOURCE + ifeq ($(RAYLIB_LIBTYPE),STATIC) + CFLAGS += -D_DEFAULT_SOURCE + endif + ifeq ($(RAYLIB_LIBTYPE),SHARED) + # Explicitly enable runtime link to libraylib.so + CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) + endif endif endif ifeq ($(PLATFORM),PLATFORM_RPI) CFLAGS += -std=gnu99 endif ifeq ($(PLATFORM),PLATFORM_WEB) - # -O2 # if used, also set --memory-init-file 0 - # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) - # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing + # -Os # size optimization + # -O2 # optimization level 2, if used, also set --memory-init-file 0 + # -s USE_GLFW=3 # Use glfw3 library (context/input management) + # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) # -s USE_PTHREADS=1 # multithreading support - # -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly) + # -s WASM=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 + # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # --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 += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources - + CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources + ifeq ($(BUILD_MODE), DEBUG) + CFLAGS += -s ASSERTIONS=1 --profiling + endif + # Define a custom shell .html and output extension CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html EXT = .html @@ -206,24 +242,40 @@ endif # Define include paths for required headers # NOTE: Several external required libraries (stb and others) -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external # Define additional directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) - # RPI requried libraries + # RPI required libraries INCLUDE_PATHS += -I/opt/vc/include INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads endif +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),BSD) + # Consider -L$(RAYLIB_H_INSTALL_PATH) + INCLUDE_PATHS += -I/usr/local/include + endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include + INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external + endif +endif -# Define library paths containing required libs -LDFLAGS += -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src +# Define library paths containing required libs. +LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),BSD) - INCLUDE_PATHS += -I/usr/local/include + # Consider -L$(RAYLIB_INSTALL_PATH) LDFLAGS += -L. -Lsrc -L/usr/local/lib endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs + LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) @@ -235,8 +287,8 @@ endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation + # NOTE: WinMM library required to set high-res timer resolution LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm - # Required for physac examples #LDLIBS += -static -lpthread endif @@ -254,11 +306,15 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(USE_WAYLAND_DISPLAY),TRUE) LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon endif + # Explicit link to libc + ifeq ($(RAYLIB_LIBTYPE),SHARED) + LDLIBS += -lc + endif endif ifeq ($(PLATFORM_OS),OSX) # Libraries for OSX 10.9 desktop compiling # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo + LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling @@ -326,7 +382,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) del *.o *.exe /s endif ifeq ($(PLATFORM_OS),LINUX) - find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f + find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv endif ifeq ($(PLATFORM_OS),OSX) find . -type f -perm +ugo+x -delete @@ -335,7 +391,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif ifeq ($(PLATFORM),PLATFORM_RPI) find . -type f -executable -delete - rm -f *.o + rm -fv *.o endif ifeq ($(PLATFORM),PLATFORM_WEB) del *.o *.html *.js diff --git a/projects/4coder/Makefile.Android b/projects/4coder/Makefile.Android index b6c68417..29d437b1 100644 --- a/projects/4coder/Makefile.Android +++ b/projects/4coder/Makefile.Android @@ -22,33 +22,33 @@ #************************************************************************************************** # Define required raylib variables -PLATFORM ?= PLATFORM_ANDROID -RAYLIB_PATH ?= ..\.. +PLATFORM ?= PLATFORM_ANDROID +RAYLIB_PATH ?= ..\.. # Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version -ANDROID_ARCH ?= ARM -ANDROID_API_VERSION = 21 +ANDROID_ARCH ?= ARM +ANDROID_API_VERSION = 21 ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif # Required path variables # NOTE: JAVA_HOME must be set to JDK -JAVA_HOME ?= C:/JavaJDK -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 -ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools +JAVA_HOME ?= C:/JavaJDK +ANDROID_HOME = C:/android-sdk +ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) +ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 +ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables -PROJECT_NAME ?= raylib_game -PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_NAME ?= raylib_game +PROJECT_LIBRARY_NAME ?= main +PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources -PROJECT_SOURCE_FILES ?= raylib_game.c +PROJECT_SOURCE_FILES ?= raylib_game.c # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. @@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME) + +# Library path for libraylib.a/libraylib.so +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 3cffaaba..c7b9162a 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -24,29 +24,43 @@ .PHONY: all clean # Define required raylib variables -# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop() -PLATFORM ?= PLATFORM_DESKTOP -RAYLIB_PATH ?= ../.. -PROJECT_NAME ?= game -DEBUGGING ?= FALSE - -# Default path for raylib on Raspberry Pi, if installed in different path, update it! -ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_PATH ?= /home/pi/raylib -endif +PROJECT_NAME ?= game +RAYLIB_VERSION ?= 2.5.0 +RAYLIB_API_VERSION ?= 2 +RAYLIB_PATH ?= C:\GitHub\raylib + +# Define default options + +# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB +PLATFORM ?= PLATFORM_DESKTOP + +# Locations of your newly installed library and associated headers. See ../src/Makefile +# On Linux, if you have installed raylib but cannot compile the examples, check that +# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations. +# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED. +# To enable compile-time linking to a special version of libraylib.so, change these variables here. +# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below. +# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime, +# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH. +# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths. +DESTDIR ?= /usr/local +RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib +# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files. +RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) -RAYLIB_LIBTYPE ?= STATIC +RAYLIB_LIBTYPE ?= STATIC + +# Build mode for project: DEBUG or RELEASE +BUILD_MODE ?= RELEASE # Use external GLFW library instead of rglfw module -USE_EXTERNAL_GLFW ?= FALSE +# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3 +USE_EXTERNAL_GLFW ?= FALSE # Use Wayland display server protocol on Linux desktop # by default it uses X11 windowing system -USE_WAYLAND_DISPLAY ?= FALSE - -# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile) - +USE_WAYLAND_DISPLAY ?= FALSE # Determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -54,7 +68,6 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) PLATFORM_OS=WINDOWS - export PATH := C:/raylib/mingw32/bin:$(PATH) else UNAMEOS=$(shell uname) ifeq ($(UNAMEOS),Linux) @@ -84,41 +97,51 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif endif -ifeq ($(PLATFORM),PLATFORM_WEB) - # Emscripten required variables - EMSDK_PATH = C:/emsdk - EMSCRIPTEN_VERSION = 1.38.8 - CLANG_VERSION = e1.38.8_64bit - PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 - NODE_VERSION = 8.9.1_64bit - export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) - EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) -endif - -RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs - -# Define raylib release directory for compiled library +# RAYLIB_PATH adjustment for different platforms. +# If using GNU make, we can get the full path to the top of the tree. Windows? BSD? +# Required for ldconfig or other tools that do not perform path expansion. ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32 - endif ifeq ($(PLATFORM_OS),LINUX) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux - endif - ifeq ($(PLATFORM_OS),OSX) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx - endif - ifeq ($(PLATFORM_OS),BSD) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd + RAYLIB_PREFIX ?= .. + RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX)) endif endif +# Default path for raylib on Raspberry Pi, if installed in different path, update it! +# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki. +# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX. ifeq ($(PLATFORM),PLATFORM_RPI) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi + RAYLIB_PATH ?= /home/pi/raylib endif + ifeq ($(PLATFORM),PLATFORM_WEB) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5 + # Emscripten required variables + EMSDK_PATH ?= C:/emsdk + EMSCRIPTEN_VERSION ?= 1.38.31 + CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit + PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64 + NODE_VERSION = 8.9.1_64bit + export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH) + EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION) endif +# Define raylib release directory for compiled library. +# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version +RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src + +# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries +# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH +# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux +# without formal installation from ../src/Makefile. It aids portability and is useful if you have +# multiple versions of raylib, have raylib installed to a non-standard location, or want to +# bundle libraylib.so with your game. Change it to your liking. +# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, +# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH, +# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) +# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute. +# To see which libraries a built example is linking to, ldd core/core_basic_window; +# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing. +EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH) + # Define default C compiler: gcc # NOTE: define g++ compiler if using C++ CC = gcc @@ -142,6 +165,8 @@ ifeq ($(PLATFORM),PLATFORM_RPI) endif ifeq ($(PLATFORM),PLATFORM_WEB) # HTML5 emscripten compiler + # WARNING: To compile to HTML5, code must be redesigned + # to use emscripten.h and emscripten_set_main_loop() CC = emcc endif @@ -152,53 +177,64 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),LINUX) MAKE = make endif - ifeq ($(PLATFORM_OS),OSX) - MAKE = make - endif endif # Define compiler flags: # -O1 defines optimization level -# -g enable debugging +# -g include debug information on compilation # -s strip unnecessary data from build # -Wall turns on most, but not all, compiler warnings # -std=c99 defines C language mode (standard C from 1999 revision) # -std=gnu99 defines C language mode (GNU C from 1999 revision) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec -ifeq ($(DEBUGGING), TRUE) +CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces + +ifeq ($(BUILD_MODE),DEBUG) CFLAGS += -g -else - CFLAGS += -O1 -s endif -CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces # Additional flags for compiler (if desired) #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) - # resources file contains windows exe icon + # resource file contains windows executable icon and properties # -Wl,--subsystem,windows hides the console window - CFLAGS += -Wl,--subsystem,windows - LDFLAGS += $(RAYLIB_PATH)/raylib.rc.data + CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) - CFLAGS += -D_DEFAULT_SOURCE + ifeq ($(RAYLIB_LIBTYPE),STATIC) + CFLAGS += -D_DEFAULT_SOURCE + endif + ifeq ($(RAYLIB_LIBTYPE),SHARED) + # Explicitly enable runtime link to libraylib.so + CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH) + endif endif endif ifeq ($(PLATFORM),PLATFORM_RPI) CFLAGS += -std=gnu99 endif ifeq ($(PLATFORM),PLATFORM_WEB) - # -O2 # if used, also set --memory-init-file 0 - # --memory-init-file 0 # to avoid an external memory initialization code file (.mem) - # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing + # -Os # size optimization + # -O2 # optimization level 2, if used, also set --memory-init-file 0 + # -s USE_GLFW=3 # Use glfw3 library (context/input management) + # -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! # -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) # -s USE_PTHREADS=1 # multithreading support - # -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly) + # -s WASM=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 + # -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data + # -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off) + # --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 += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources - + CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources + ifeq ($(BUILD_MODE), DEBUG) + CFLAGS += -s ASSERTIONS=1 --profiling + endif + # Define a custom shell .html and output extension CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html EXT = .html @@ -206,24 +242,40 @@ endif # Define include paths for required headers # NOTE: Several external required libraries (stb and others) -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external # Define additional directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) - # RPI requried libraries + # RPI required libraries INCLUDE_PATHS += -I/opt/vc/include INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads endif +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),BSD) + # Consider -L$(RAYLIB_H_INSTALL_PATH) + INCLUDE_PATHS += -I/usr/local/include + endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include + INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external + endif +endif -# Define library paths containing required libs -LDFLAGS += -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src +# Define library paths containing required libs. +LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),BSD) - INCLUDE_PATHS += -I/usr/local/include + # Consider -L$(RAYLIB_INSTALL_PATH) LDFLAGS += -L. -Lsrc -L/usr/local/lib endif + ifeq ($(PLATFORM_OS),LINUX) + # Reset everything. + # Precedence: immediately local, installed version, raysan5 provided libs + LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) @@ -235,8 +287,8 @@ endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # Libraries for Windows desktop compilation - LDLIBS = -lraylib -lopengl32 -lgdi32 - + # NOTE: WinMM library required to set high-res timer resolution + LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm # Required for physac examples #LDLIBS += -static -lpthread endif @@ -254,11 +306,15 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(USE_WAYLAND_DISPLAY),TRUE) LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon endif + # Explicit link to libc + ifeq ($(RAYLIB_LIBTYPE),SHARED) + LDLIBS += -lc + endif endif ifeq ($(PLATFORM_OS),OSX) # Libraries for OSX 10.9 desktop compiling # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo + LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling @@ -326,7 +382,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) del *.o *.exe /s endif ifeq ($(PLATFORM_OS),LINUX) - find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f + find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv endif ifeq ($(PLATFORM_OS),OSX) find . -type f -perm +ugo+x -delete @@ -335,7 +391,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif ifeq ($(PLATFORM),PLATFORM_RPI) find . -type f -executable -delete - rm -f *.o + rm -fv *.o endif ifeq ($(PLATFORM),PLATFORM_WEB) del *.o *.html *.js diff --git a/projects/VSCode/Makefile.Android b/projects/VSCode/Makefile.Android index b6c68417..29d437b1 100644 --- a/projects/VSCode/Makefile.Android +++ b/projects/VSCode/Makefile.Android @@ -22,33 +22,33 @@ #************************************************************************************************** # Define required raylib variables -PLATFORM ?= PLATFORM_ANDROID -RAYLIB_PATH ?= ..\.. +PLATFORM ?= PLATFORM_ANDROID +RAYLIB_PATH ?= ..\.. # Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version -ANDROID_ARCH ?= ARM -ANDROID_API_VERSION = 21 +ANDROID_ARCH ?= ARM +ANDROID_API_VERSION = 21 ifeq ($(ANDROID_ARCH),ARM) - ANDROID_ARCH_NAME = armeabi-v7a + ANDROID_ARCH_NAME = armeabi-v7a endif ifeq ($(ANDROID_ARCH),ARM64) - ANDROID_ARCH_NAME = arm64-v8a + ANDROID_ARCH_NAME = arm64-v8a endif # Required path variables # NOTE: JAVA_HOME must be set to JDK -JAVA_HOME ?= C:/JavaJDK -ANDROID_HOME = C:/android-sdk -ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) -ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 -ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools +JAVA_HOME ?= C:/JavaJDK +ANDROID_HOME = C:/android-sdk +ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION) +ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1 +ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools # Android project configuration variables -PROJECT_NAME ?= raylib_game -PROJECT_LIBRARY_NAME ?= main -PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) +PROJECT_NAME ?= raylib_game +PROJECT_LIBRARY_NAME ?= main +PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME) PROJECT_RESOURCES_PATH ?= resources -PROJECT_SOURCE_FILES ?= raylib_game.c +PROJECT_SOURCE_FILES ?= raylib_game.c # Some source files are placed in directories, when compiling to some # output directory other than source, that directory must pre-exist. @@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) RAYLIB_LIBTYPE ?= STATIC -RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME) + +# Library path for libraylib.a/libraylib.so +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src # Shared libs must be added to APK if required # NOTE: Generated NativeLoader.java automatically load those libraries @@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) # Paths containing required header files -INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue +INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue # Linker options LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a -- cgit v1.2.3 From be7e56f51e0f9c1c8bf38cab8d451f148b46458b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 22 May 2019 10:40:51 +0200 Subject: Move emscripten web shell to src --- projects/4coder/Makefile | 2 +- projects/VSCode/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'projects') diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index c7b9162a..63d093a2 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index c7b9162a..63d093a2 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif -- cgit v1.2.3 From 228f86d3cad9bbad2fb585cc2a1fbe48723757ec Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Wed, 29 May 2019 16:09:24 +0300 Subject: Fix and update projects/scripts --- projects/scripts/build-linux.sh | 51 ++++++----- projects/scripts/build-osx.sh | 45 +++++++--- projects/scripts/build-rpi.sh | 169 +++++++++++++++++++++++++++++++++++++ projects/scripts/build-windows.bat | 34 ++++---- 4 files changed, 250 insertions(+), 49 deletions(-) create mode 100755 projects/scripts/build-rpi.sh (limited to 'projects') diff --git a/projects/scripts/build-linux.sh b/projects/scripts/build-linux.sh index 965542ce..5a004ddd 100644 --- a/projects/scripts/build-linux.sh +++ b/projects/scripts/build-linux.sh @@ -2,13 +2,13 @@ # Change your executable name here GAME_NAME="game" -# Set your sources here (relative to the ./builds/linux directory) +# Set your sources here (relative paths!) # Example with two source folders: -# SOURCES="../../src/*.c ../../src/submodule/*.c" -SOURCES="../../core_basic_window.c" +# SOURCES="src/*.c src/submodule/*.c" +SOURCES="core_basic_window.c" -# Set your raylib/src location here, relative to the ./temp/x directory -RAYLIB_SRC="../../../../src" +# Set your raylib/src location here (relative path!) +RAYLIB_SRC="../../src" # About this build script: it does many things, but in essence, it's # very simple. It has 3 compiler invocations: building raylib (which @@ -17,14 +17,18 @@ RAYLIB_SRC="../../../../src" # wrapped in an if statement to make the -qq flag work, it's pretty # verbose, sorry. +# Stop the script if a compilation (or something else?) fails +set -e + # Get arguments -while getopts ":hdurcq" opt; do +while getopts ":hdusrcq" opt; do case $opt in h) - echo "Usage: ./linux-build.sh [-hdurcqq]" + echo "Usage: ./linux-build.sh [-hdusrcqq]" echo " -h Show this information" echo " -d Faster builds that have debug symbols, and enable warnings" echo " -u Run upx* on the executable after compilation (before -r)" + echo " -s Run strip on the executable after compilation (before -r)" echo " -r Run the executable after compilation" echo " -c Remove the temp/(debug|release) directory, ie. full recompile" echo " -q Suppress this script's informational prints" @@ -47,6 +51,9 @@ while getopts ":hdurcq" opt; do u) UPX_IT="1" ;; + s) + STRIP_IT="1" + ;; r) RUN_AFTER_BUILD="1" ;; @@ -72,23 +79,23 @@ if [ -z "$CC" ]; then CC=cc fi +# Directories +ROOT_DIR=$PWD +SOURCES="$ROOT_DIR/$SOURCES" +RAYLIB_SRC="$ROOT_DIR/$RAYLIB_SRC" + # Flags OUTPUT_DIR="builds/linux" COMPILATION_FLAGS="-std=c99 -Os -flto" -if [ "$CC" = "clang" ]; then - # Clang 7.0.1 fails to compile with -Os, possibly the same bug as this: - # https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg25771.html - COMPILATION_FLAGS="-std=c99 -O2 -flto" - [ -z "$QUIET" ] && echo "COMPILE-WARNING: \$CC is clang, using -O2 instead of -Os." -fi FINAL_COMPILE_FLAGS="-s" WARNING_FLAGS="-Wall -Wextra -Wpedantic" -LINK_FLAGS="-lm -ldl -lpthread -lX11 -lxcb -lGL -lGLX -lXext -lGLdispatch -lXau -lXdmcp" +LINK_FLAGS="-flto -lm -ldl -lpthread -lX11 -lxcb -lGL -lGLX -lXext -lGLdispatch -lXau -lXdmcp" # Debug changes to flags if [ -n "$BUILD_DEBUG" ]; then OUTPUT_DIR="builds-debug/linux" COMPILATION_FLAGS="-std=c99 -O0 -g" FINAL_COMPILE_FLAGS="" + LINK_FLAGS="-lm -ldl -lpthread -lX11 -lxcb -lGL -lGLX -lXext -lGLdispatch -lXau -lXdmcp" fi # Display what we're doing @@ -99,7 +106,6 @@ else fi # Create the raylib cache directory -ROOT_DIR=$(pwd) TEMP_DIR="temp/release" if [ -n "$BUILD_DEBUG" ]; then TEMP_DIR="temp/debug" @@ -131,15 +137,20 @@ mkdir -p $OUTPUT_DIR cd $OUTPUT_DIR [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling game code." if [ -n "$REALLY_QUIET" ]; then - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS > /dev/null 2>&1 + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS > /dev/null 2>&1 else - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS fi -rm main.o +rm *.o [ -z "$QUIET" ] && echo "COMPILE-INFO: Game compiled into an executable in: $OUTPUT_DIR/" +if [ -n "$STRIP_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Stripping $GAME_NAME." + strip $GAME_NAME +fi + if [ -n "$UPX_IT" ]; then [ -z "$QUIET" ] && echo "COMPILE-INFO: Packing $GAME_NAME with upx." upx $GAME_NAME > /dev/null 2>&1 diff --git a/projects/scripts/build-osx.sh b/projects/scripts/build-osx.sh index 1a5ad743..13a421f9 100644 --- a/projects/scripts/build-osx.sh +++ b/projects/scripts/build-osx.sh @@ -2,13 +2,13 @@ # Change your executable name here GAME_NAME="game" -# Set your sources here (relative to the ./builds/osx directory) +# Set your sources here (relative paths!) # Example with two source folders: -# SOURCES="../../src/*.c ../../src/submodule/*.c" -SOURCES="../../core_basic_window.c" +# SOURCES="src/*.c src/submodule/*.c" +SOURCES="core_basic_window.c" -# Set your raylib/src location here, relative to the ./temp/x directory -RAYLIB_SRC="../../../../src" +# Set your raylib/src location here (relative path!) +RAYLIB_SRC="../../src" # About this build script: it does many things, but in essence, it's # very simple. It has 3 compiler invocations: building raylib (which @@ -17,14 +17,18 @@ RAYLIB_SRC="../../../../src" # wrapped in an if statement to make the -qq flag work, it's pretty # verbose, sorry. +# Stop the script if a compilation (or something else?) fails +set -e + # Get arguments -while getopts ":hdurcq" opt; do +while getopts ":hdusrcq" opt; do case $opt in h) - echo "Usage: ./osx-build.sh [-hdurcqq]" + echo "Usage: ./osx-build.sh [-hdusrcqq]" echo " -h Show this information" echo " -d Faster builds that have debug symbols, and enable warnings" echo " -u Run upx* on the executable after compilation (before -r)" + echo " -s Run strip on the executable after compilation (before -r)" echo " -r Run the executable after compilation" echo " -c Remove the temp/(debug|release) directory, ie. full recompile" echo " -q Suppress this script's informational prints" @@ -47,6 +51,9 @@ while getopts ":hdurcq" opt; do u) UPX_IT="1" ;; + s) + STRIP_IT="1" + ;; r) RUN_AFTER_BUILD="1" ;; @@ -72,17 +79,23 @@ if [ -z "$CC" ]; then CC=cc fi +# Directories +ROOT_DIR=$PWD +SOURCES="$ROOT_DIR/$SOURCES" +RAYLIB_SRC="$ROOT_DIR/$RAYLIB_SRC" + # Flags OUTPUT_DIR="builds/osx" COMPILATION_FLAGS="-std=c99 -O2 -flto" FINAL_COMPILE_FLAGS="-s" WARNING_FLAGS="-Wall -Wextra -Wpedantic" -LINK_FLAGS="-framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" +LINK_FLAGS="-flto -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" # Debug changes to flags if [ -n "$BUILD_DEBUG" ]; then OUTPUT_DIR="builds-debug/osx" COMPILATION_FLAGS="-std=c99 -O0 -g" FINAL_COMPILE_FLAGS="" + LINK_FLAGS="-framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" fi # Display what we're doing @@ -93,7 +106,6 @@ else fi # Create the raylib cache directory -ROOT_DIR=$(pwd) TEMP_DIR="temp/release" if [ -n "$BUILD_DEBUG" ]; then TEMP_DIR="temp/debug" @@ -127,15 +139,20 @@ mkdir -p $OUTPUT_DIR cd $OUTPUT_DIR [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling game code." if [ -n "$REALLY_QUIET" ]; then - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS > /dev/null 2>&1 + $CC -c -I$RAYLIB_SRC $SOURCES $COMPILATION_FLAGS $WARNING_FLAGS > /dev/null 2>&1 + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS > /dev/null 2>&1 else - $CC -c -o main.o -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES - $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o main.o $LINK_FLAGS + $CC -c -I$RAYLIB_SRC $SOURCES $COMPILATION_FLAGS $WARNING_FLAGS + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS fi -rm main.o +rm *.o [ -z "$QUIET" ] && echo "COMPILE-INFO: Game compiled into an executable in: $OUTPUT_DIR/" +if [ -n "$STRIP_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Stripping $GAME_NAME." + strip $GAME_NAME +fi + if [ -n "$UPX_IT" ]; then [ -z "$QUIET" ] && echo "COMPILE-INFO: Packing $GAME_NAME with upx." upx $GAME_NAME > /dev/null 2>&1 diff --git a/projects/scripts/build-rpi.sh b/projects/scripts/build-rpi.sh new file mode 100755 index 00000000..85b39b04 --- /dev/null +++ b/projects/scripts/build-rpi.sh @@ -0,0 +1,169 @@ +#!/bin/sh +# Change your executable name here +GAME_NAME="game" + +# Set your sources here (relative paths!) +# Example with two source folders: +# SOURCES="src/*.c src/submodule/*.c" +SOURCES="core_basic_window.c" + +# Set your raylib/src location here (relative path!) +RAYLIB_SRC="../../src" + +# About this build script: it does many things, but in essence, it's +# very simple. It has 3 compiler invocations: building raylib (which +# is not done always, see logic by searching "Build raylib"), building +# src/*.c files, and linking together those two. Each invocation is +# wrapped in an if statement to make the -qq flag work, it's pretty +# verbose, sorry. + +# Stop the script if a compilation (or something else?) fails +set -e + +# Get arguments +while getopts ":hdusrcq" opt; do + case $opt in + h) + echo "Usage: ./linux-build.sh [-hdusrcqq]" + echo " -h Show this information" + echo " -d Faster builds that have debug symbols, and enable warnings" + echo " -u Run upx* on the executable after compilation (before -r)" + echo " -s Run strip on the executable after compilation (before -r)" + echo " -r Run the executable after compilation" + echo " -c Remove the temp/(debug|release) directory, ie. full recompile" + echo " -q Suppress this script's informational prints" + echo " -qq Suppress all prints, complete silence (> /dev/null 2>&1)" + echo "" + echo "* This is mostly here to make building simple \"shipping\" versions" + echo " easier, and it's a very small bit in the build scripts. The option" + echo " requires that you have upx installed and on your path, of course." + echo "" + echo "Examples:" + echo " Build a release build: ./linux-build.sh" + echo " Build a release build, full recompile: ./linux-build.sh -c" + echo " Build a debug build and run: ./linux-build.sh -d -r" + echo " Build in debug, run, don't print at all: ./linux-build.sh -drqq" + exit 0 + ;; + d) + BUILD_DEBUG="1" + ;; + u) + UPX_IT="1" + ;; + s) + STRIP_IT="1" + ;; + r) + RUN_AFTER_BUILD="1" + ;; + c) + BUILD_ALL="1" + ;; + q) + if [ -n "$QUIET" ]; then + REALLY_QUIET="1" + else + QUIET="1" + fi + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + esac +done + +# Set CC if it's not set already +if [ -z "$CC" ]; then + CC=cc +fi + +# Directories +ROOT_DIR=$PWD +SOURCES="$ROOT_DIR/$SOURCES" +RAYLIB_SRC="$ROOT_DIR/$RAYLIB_SRC" + +# Flags +OUTPUT_DIR="builds/linux" +COMPILATION_FLAGS="-std=c99 -Os -flto" +FINAL_COMPILE_FLAGS="-s" +WARNING_FLAGS="-Wall -Wextra -Wpedantic" +LINK_FLAGS="-flto -lm -ldl -lrt -lpthread -lv4l2 -lbrcmGLESv2 -lbrcmEGL -lbcm_host -L/opt/vc/lib" +# Debug changes to flags +if [ -n "$BUILD_DEBUG" ]; then + OUTPUT_DIR="builds-debug/linux" + COMPILATION_FLAGS="-std=c99 -O0 -g" + FINAL_COMPILE_FLAGS="" + LINK_FLAGS="-lm -ldl -lrt -lpthread -lv4l2 -lbrcmGLESv2 -lbrcmEGL -lbcm_host -L/opt/vc/lib" +fi + +# Display what we're doing +if [ -n "$BUILD_DEBUG" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling in debug mode. ($COMPILATION_FLAGS $WARNING_FLAGS)" +else + [ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling in release mode. ($COMPILATION_FLAGS $FINAL_COMPILE_FLAGS)" +fi + +# Create the raylib cache directory +TEMP_DIR="temp/release" +if [ -n "$BUILD_DEBUG" ]; then + TEMP_DIR="temp/debug" +fi +# If there's a -c flag, remove the cache +if [ -d "$TEMP_DIR" ] && [ -n "$BUILD_ALL" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Found cached raylib, rebuilding." + rm -r "$TEMP_DIR" +fi +# If temp directory doesn't exist, build raylib +if [ ! -d "$TEMP_DIR" ]; then + mkdir -p $TEMP_DIR + cd $TEMP_DIR + RAYLIB_DEFINES="-D_DEFAULT_SOURCE -DPLATFORM_RPI -DGRAPHICS_API_OPENGL_ES2" + RAYLIB_C_FILES="$RAYLIB_SRC/core.c $RAYLIB_SRC/shapes.c $RAYLIB_SRC/textures.c $RAYLIB_SRC/text.c $RAYLIB_SRC/models.c $RAYLIB_SRC/utils.c $RAYLIB_SRC/raudio.c" + RAYLIB_INCLUDE_FLAGS="-I$RAYLIB_SRC -I/opt/vc/include" + + if [ -n "$REALLY_QUIET" ]; then + $CC -c $RAYLIB_DEFINES $RAYLIB_INCLUDE_FLAGS $COMPILATION_FLAGS $RAYLIB_C_FILES > /dev/null 2>&1 + else + $CC -c $RAYLIB_DEFINES $RAYLIB_INCLUDE_FLAGS $COMPILATION_FLAGS $RAYLIB_C_FILES + fi + [ -z "$QUIET" ] && echo "COMPILE-INFO: Raylib compiled into object files in: $TEMP_DIR/" + cd $ROOT_DIR +fi + +# Build the actual game +mkdir -p $OUTPUT_DIR +cd $OUTPUT_DIR +[ -z "$QUIET" ] && echo "COMPILE-INFO: Compiling game code." +if [ -n "$REALLY_QUIET" ]; then + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES > /dev/null 2>&1 + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS > /dev/null 2>&1 +else + $CC -c -I$RAYLIB_SRC $COMPILATION_FLAGS $WARNING_FLAGS $SOURCES + $CC -o $GAME_NAME $ROOT_DIR/$TEMP_DIR/*.o *.o $LINK_FLAGS +fi +rm *.o +[ -z "$QUIET" ] && echo "COMPILE-INFO: Game compiled into an executable in: $OUTPUT_DIR/" + +if [ -n "$STRIP_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Stripping $GAME_NAME." + strip $GAME_NAME +fi + +if [ -n "$UPX_IT" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Packing $GAME_NAME with upx." + upx $GAME_NAME > /dev/null 2>&1 +fi + +if [ -n "$RUN_AFTER_BUILD" ]; then + [ -z "$QUIET" ] && echo "COMPILE-INFO: Running." + if [ -n "$REALLY_QUIET" ]; then + ./$GAME_NAME > /dev/null 2>&1 + else + ./$GAME_NAME + fi +fi +cd $ROOT_DIR + +[ -z "$QUIET" ] && echo "COMPILE-INFO: All done." diff --git a/projects/scripts/build-windows.bat b/projects/scripts/build-windows.bat index b179b560..98ab548d 100644 --- a/projects/scripts/build-windows.bat +++ b/projects/scripts/build-windows.bat @@ -2,13 +2,13 @@ REM Change your executable name here set GAME_NAME=game.exe -REM Set your sources here (relative to the builds\windows directory) +REM Set your sources here (relative paths!) REM Example with two source folders: -REM set SOURCES=..\..\src\*.c ..\..\src\submodule\*.c -set SOURCES=..\..\core_basic_window.c +REM set SOURCES=src\*.c src\submodule\*.c +set SOURCES=core_basic_window.c -REM Set your raylib/src location here, relative to the ./temp/x directory -set RAYLIB_SRC=..\..\..\..\src +REM Set your raylib\src location here (relative path!) +set RAYLIB_SRC=..\..\src REM About this build script: it does many things, but in essence, it's REM very simple. It has 3 compiler invocations: building raylib (which @@ -111,13 +111,18 @@ IF DEFINED VERBOSE ( :BUILD +REM Directories +set "ROOT_DIR=%CD%" +set "SOURCES=!ROOT_DIR!\!SOURCES!" +set "RAYLIB_SRC=!ROOT_DIR!\!RAYLIB_SRC!" + REM Flags set OUTPUT_FLAG=/Fe: "!GAME_NAME!" set COMPILATION_FLAGS=/O1 /GL set WARNING_FLAGS= set SUBSYSTEM_FLAGS=/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup set LINK_FLAGS=/link /LTCG kernel32.lib user32.lib shell32.lib winmm.lib gdi32.lib opengl32.lib -set OUTPUT_DIR=builds\windows +set OUTPUT_DIR=builds\windows-msvc REM Debug changes to flags IF DEFINED BUILD_DEBUG ( set OUTPUT_FLAG=/Fe: "!GAME_NAME!" @@ -125,7 +130,7 @@ IF DEFINED BUILD_DEBUG ( set WARNING_FLAGS=/Wall set SUBSYSTEM_FLAGS= set LINK_FLAGS=/link kernel32.lib user32.lib shell32.lib winmm.lib gdi32.lib opengl32.lib - set OUTPUT_DIR=builds-debug\windows + set OUTPUT_DIR=builds-debug\windows-msvc ) IF NOT DEFINED VERBOSE ( set VERBOSITY_FLAG=/nologo @@ -139,7 +144,6 @@ IF DEFINED BUILD_DEBUG ( ) REM Create the temp directory for raylib -set "ROOT_DIR=%CD%" set "TEMP_DIR=temp\release" IF DEFINED BUILD_DEBUG ( set "TEMP_DIR=temp\debug" @@ -163,9 +167,9 @@ IF NOT EXIST !TEMP_DIR!\ ( set RAYLIB_INCLUDE_FLAGS=/I"!RAYLIB_SRC!" /I"!RAYLIB_SRC!\external\glfw\include" IF DEFINED REALLY_QUIET ( - cl.exe /w /c !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! > NUL 2>&1 + cl.exe /w /c !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! > NUL 2>&1 || exit /B ) ELSE ( - cl.exe /w /c !VERBOSITY_FLAG! !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! + cl.exe /w /c !VERBOSITY_FLAG! !RAYLIB_DEFINES! !RAYLIB_INCLUDE_FLAGS! !COMPILATION_FLAGS! !RAYLIB_C_FILES! || exit /B ) IF NOT DEFINED QUIET echo COMPILE-INFO: Raylib compiled into object files in: !TEMP_DIR!\ @@ -180,13 +184,13 @@ cd !OUTPUT_DIR! REM Build the actual game IF NOT DEFINED QUIET echo COMPILE-INFO: Compiling game code. IF DEFINED REALLY_QUIET ( - cl.exe !VERBOSITY_FLAG! /Fo"main.obj" !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! > NUL 2>&1 - cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" main.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! > NUL 2>&1 + cl.exe !VERBOSITY_FLAG! !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! > NUL 2>&1 || exit /B + cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" *.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! > NUL 2>&1 || exit /B ) ELSE ( - cl.exe !VERBOSITY_FLAG! /Fo"main.obj" !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! - cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" main.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! + cl.exe !VERBOSITY_FLAG! !COMPILATION_FLAGS! !WARNING_FLAGS! /c /I"!RAYLIB_SRC!" !SOURCES! || exit /B + cl.exe !VERBOSITY_FLAG! !OUTPUT_FLAG! "!ROOT_DIR!\!TEMP_DIR!\*.obj" *.obj !LINK_FLAGS! !SUBSYSTEM_FLAGS! || exit /B ) -del main.obj +del *.obj IF NOT DEFINED QUIET echo COMPILE-INFO: Game compiled into an executable in: !OUTPUT_DIR!\ REM Run upx -- cgit v1.2.3 From 22cd55d58566890875de9c21595b08c33839f52c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 30 May 2019 17:25:01 +0200 Subject: Updated Notepad++ intellisense to raylib 2.5 --- .../Notepad++/raylib_npp_parser/raylib_npp.xml | 597 +++++++++++++++++---- .../raylib_npp_parser/raylib_npp_parser.c | 2 + .../Notepad++/raylib_npp_parser/raylib_to_parse.h | 167 ++++-- 3 files changed, 623 insertions(+), 143 deletions(-) (limited to 'projects') diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml index e04fc932..019850e1 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp.xml @@ -10,21 +10,33 @@ + + + - - - + + + + + + + + + + + + @@ -58,12 +70,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -170,6 +221,11 @@ + + + + + @@ -183,21 +239,28 @@ - - - - - - + + + + + + + + + + + + + - + @@ -216,6 +279,11 @@ + + + + + @@ -232,6 +300,11 @@ + + + + + @@ -240,6 +313,15 @@ + + + + + + + + + @@ -249,12 +331,17 @@ - + - + + + + + + @@ -270,6 +357,12 @@ + + + + + + @@ -392,12 +485,20 @@ - + + + + + + + + - + + @@ -543,6 +644,13 @@ + + + + + + + @@ -551,6 +659,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -575,6 +703,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -650,6 +800,23 @@ + + + + + + + + + + + + + + + + + @@ -666,6 +833,13 @@ + + + + + + + @@ -675,18 +849,11 @@ - - - - - - - - - - - - + + + + + @@ -770,9 +937,15 @@ - + + + + + + + @@ -785,6 +958,12 @@ + + + + + + @@ -828,6 +1007,9 @@ + + + @@ -884,14 +1066,14 @@ - + - + @@ -921,6 +1103,13 @@ + + + + + + + @@ -948,11 +1137,18 @@ - + + + + + + + + @@ -1148,6 +1344,15 @@ + + + + + + + + + @@ -1158,6 +1363,16 @@ + + + + + + + + + + @@ -1176,8 +1391,15 @@ - + + + + + + + + @@ -1186,14 +1408,14 @@ - + - + @@ -1221,15 +1443,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1246,23 +1492,109 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1312,6 +1644,13 @@ + + + + + + + @@ -1399,12 +1738,12 @@ - + - + @@ -1415,8 +1754,15 @@ - - + + + + + + + + + @@ -1425,31 +1771,70 @@ - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - - - + + + + + - - - + + + + + + + + + + + + + + + @@ -1515,18 +1900,20 @@ - - - - + + + + - - + + + + - - - + + + @@ -1701,19 +2088,20 @@ - + - - + + - - + + - - + + + @@ -1723,6 +2111,13 @@ + + + + + + + @@ -1763,9 +2158,8 @@ - + - @@ -1787,34 +2181,39 @@ - - - - - + + + + + + + + + + + - - - + - - - - - - - - + + + + + + + + + @@ -1881,6 +2280,18 @@ + + + + + + + + + + + + diff --git a/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c b/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c index 7ab55189..f2c115f3 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c +++ b/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c @@ -17,6 +17,8 @@ NOTE: Generated XML text should be copied inside raylib\Notepad++\plugins\APIs\c.xml + + WARNING: Be careful with functions that split parameters into several lines, it breaks the process! LICENSE: zlib/libpng diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 08e24c35..a572c0d6 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -4,22 +4,32 @@ // Window-related functions RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context +RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed RLAPI void CloseWindow(void); // Close window and unload OpenGL context RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully -RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus) +RLAPI bool IsWindowResized(void); // Check if window has been resized +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP) +RLAPI void UnhideWindow(void); // Show the window +RLAPI void HideWindow(void); // Hide the window RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) RLAPI void SetWindowSize(int width, int height); // Set window dimensions -RLAPI void ShowWindow(); // Show the window -RLAPI void HideWindow(); // Hide the window -RLAPI bool IsWindowHidden(); // Check if window is currently hidden +RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height +RLAPI int GetMonitorCount(void); // Get number of connected monitors +RLAPI int GetMonitorWidth(int monitor); // Get primary monitor width +RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height +RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres +RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres +RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor +RLAPI const char *GetClipboardText(void); // Get clipboard text content +RLAPI void SetClipboardText(const char *text); // Set clipboard text content // Cursor-related functions RLAPI void ShowCursor(void); // Shows cursor @@ -54,32 +64,41 @@ RLAPI double GetTime(void); // Returns ela RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color RLAPI Vector4 ColorNormalize(Color color); // Returns color normalized as float [0..1] RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color +RLAPI Color ColorFromHSV(Vector3 hsv); // Returns a Color from HSV values RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f // Misc. functions -RLAPI void ShowLogo(void); // Activate raylib logo at startup (can be done with flags) RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS) -RLAPI void SetTraceLog(unsigned char types); // Enable trace log message types (bit flags based) -RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG) +RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level +RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging +RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) // Files management functions +RLAPI bool FileExists(const char *fileName); // Check if file exists RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension RLAPI const char *GetExtension(const char *fileName); // Get pointer to extension for a filename string RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string +RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (memory should be freed) RLAPI const char *GetDirectoryPath(const char *fileName); // Get full path for a given fileName (uses static string) RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) +RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) +RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, returns true if success RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -RLAPI char **GetDroppedFiles(int *count); // Get dropped files names -RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer +RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) +RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Persistent storage management RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position) RLAPI int StorageLoadValue(int position); // Load integer value from storage file (from defined position) +RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) + //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ @@ -112,8 +131,9 @@ RLAPI bool IsMouseButtonUp(int button); // Detect if a mou RLAPI int GetMouseX(void); // Returns mouse position X RLAPI int GetMouseY(void); // Returns mouse position Y RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY -RLAPI void SetMousePosition(Vector2 position); // Set mouse position XY -RLAPI void SetMouseScale(float scale); // Set mouse scaling +RLAPI void SetMousePosition(int x, int y); // Set mouse position XY +RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset +RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y // Input-related functions: touch @@ -156,10 +176,15 @@ RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Colo RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +RLAPI void DrawLineStrip(Vector2 *points, int numPoints, Color color); // Draw lines sequence RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int 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 RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle @@ -169,11 +194,14 @@ RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Col RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline +RLAPI void DrawTriangleFan(Vector2 *points, int numPoints, Color color); // Draw a triangle fan defined by points RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -RLAPI void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points -RLAPI void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines + +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes // Basic shapes collision detection functions RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles @@ -193,9 +221,11 @@ RLAPI Image LoadImage(const char *fileName); RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit) RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -RLAPI void ExportImage(const char *fileName, Image image); // Export image as a PNG file +RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file +RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) @@ -204,6 +234,7 @@ RLAPI Color *GetImageData(Image image); RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized) RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture) RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image +RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data // Image manipulation functions @@ -215,15 +246,17 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) -RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor 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 ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); // Extract color palette from image to maximum size (memory should be freed) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image -RLAPI void ImageDrawRectangle(Image *dst, Vector2 position, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangle(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically @@ -257,8 +290,9 @@ RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters - +RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters +RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) @@ -267,22 +301,43 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest // Font loading/unloading functions RLAPI Font GetFontDefault(void); // Get the default Font RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters -RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use -RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters +RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) +RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use +RLAPI Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) // Text drawing functions RLAPI void DrawFPS(int posX, int posY); // Shows current FPS RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters +RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits +RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack); // Draw text using font inside rectangle limits with support for text selection // Text misc. functions RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' -RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string -RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font +RLAPI int GetGlyphIndex(Font font, int character); // Get index position for a unicode character on font +RLAPI int GetNextCodepoint(const char *text, int *count); // Returns next codepoint in a UTF8 encoded string + // NOTE: 0x3f(`?`) is returned on failure, `count` will hold the total number of bytes processed + +// Text strings management functions +// NOTE: Some strings allocate memory internally for returned strings, just be careful! +RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending +RLAPI unsigned int TextCountCodepoints(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string +RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style) +RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string +RLAPI const char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory should be freed!) +RLAPI const char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory should be freed!) +RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! +RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string +RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) @@ -294,6 +349,7 @@ RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, floa RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters @@ -311,21 +367,30 @@ RLAPI void DrawGizmo(Vector3 position); //------------------------------------------------------------------------------------ // Model loading/unloading functions -RLAPI Model LoadModel(const char *fileName); // Load model from files (mesh and material) -RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) // Mesh loading/unloading functions -RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from file +RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file +RLAPI void ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file RLAPI void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM) -RLAPI void ExportMesh(const char *fileName, Mesh mesh); // Export mesh as an OBJ file -// Mesh manipulation functions -RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents -RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals +// Material loading/unloading functions +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh + +// Model animations loading/unloading functions +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Mesh generation functions +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) @@ -336,10 +401,10 @@ RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data -// Material loading/unloading functions -RLAPI Material LoadMaterial(const char *fileName); // Load material from file -RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +// Mesh manipulation functions +RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) @@ -376,12 +441,11 @@ RLAPI Shader GetShaderDefault(void); // Get RLAPI Texture2D GetTextureDefault(void); // Get default texture // Shader configuration functions -RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -RLAPI void SetShaderValue(Shader shader, int uniformLoc, const float *value, int size); // Set shader uniform value (float) -RLAPI void SetShaderValuei(Shader shader, int uniformLoc, const int *value, int size); // Set shader uniform value (int) -RLAPI void SetShaderValueArray(Shader shader, int uniformLoc, const float *value, int size, int count); // Set shader uniform value (array of float/vec2/vec3/vec4) -RLAPI void SetShaderValueArrayi(Shader shader, int uniformLoc, const int *value, int size, int count); // Set shader uniform value (array of int/ivec2/ivec3/ivec4) -RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) RLAPI Matrix GetMatrixModelview(); // Get internal modelview matrix @@ -391,21 +455,22 @@ RLAPI Matrix GetMatrixModelview(); // Get RLAPI Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size); // Generate cubemap texture from HDR texture RLAPI Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size); // Generate irradiance texture using cubemap data RLAPI Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size); // Generate prefilter texture using cubemap data -RLAPI Texture2D GenTextureBRDF(Shader shader, Texture2D cubemap, int size); // Generate BRDF texture using cubemap data +RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture // Shading begin/end functions RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) +RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) +RLAPI void EndScissorMode(void); // End scissor mode // VR control functions -RLAPI VrDeviceInfo GetVrDeviceInfo(int vrDeviceType); // Get VR device information for some standard devices -RLAPI void InitVrSimulator(VrDeviceInfo info); // Init VR simulator for selected device parameters +RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters RLAPI void CloseVrSimulator(void); // Close VR simulator for current device -RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready -RLAPI void SetVrDistortionShader(Shader shader); // Set VR distortion shader for stereoscopic rendering RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera +RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters +RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready RLAPI void ToggleVrMode(void); // Enable/Disable VR experience RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering @@ -428,6 +493,8 @@ RLAPI Sound LoadSoundFromWave(Wave wave); // Load so RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound +RLAPI void ExportWave(Wave wave, const char *fileName); // Export wave data to file +RLAPI void ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h) // Wave/Sound management functions RLAPI void PlaySound(Sound sound); // Play a sound @@ -468,4 +535,4 @@ RLAPI void ResumeAudioStream(AudioStream stream); // Resume RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) -RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) \ No newline at end of file +RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) -- cgit v1.2.3 From e5a73b7398808131adcd4ddb0c230fa2d8d9334e Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 30 May 2019 17:44:06 +0200 Subject: Review compiler scripts --- projects/Notepad++/npes_saved_mingw.txt | Bin 7524 -> 7390 bytes projects/Notepad++/npes_saved_tcc.txt | Bin 7466 -> 7418 bytes 2 files changed, 0 insertions(+), 0 deletions(-) (limited to 'projects') diff --git a/projects/Notepad++/npes_saved_mingw.txt b/projects/Notepad++/npes_saved_mingw.txt index 41e25823..6363218f 100644 Binary files a/projects/Notepad++/npes_saved_mingw.txt and b/projects/Notepad++/npes_saved_mingw.txt differ diff --git a/projects/Notepad++/npes_saved_tcc.txt b/projects/Notepad++/npes_saved_tcc.txt index 82f88aaf..c2103b6e 100644 Binary files a/projects/Notepad++/npes_saved_tcc.txt and b/projects/Notepad++/npes_saved_tcc.txt differ -- cgit v1.2.3 From 22a363d1ec7b4c6220ce633d60a35f03293b75b2 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 31 May 2019 10:03:17 +0200 Subject: Update npes_saved_tcc.txt --- projects/Notepad++/npes_saved_tcc.txt | Bin 7418 -> 7426 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'projects') diff --git a/projects/Notepad++/npes_saved_tcc.txt b/projects/Notepad++/npes_saved_tcc.txt index c2103b6e..97548bdb 100644 Binary files a/projects/Notepad++/npes_saved_tcc.txt and b/projects/Notepad++/npes_saved_tcc.txt differ -- cgit v1.2.3 From 65474c621c1f351b21c75095026288cfff143e9b Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 31 May 2019 11:59:06 +0200 Subject: Update raylib.c.tags --- projects/Geany/raylib.c.tags | 180 ++++++++++++++++++++++++++++++------------- 1 file changed, 126 insertions(+), 54 deletions(-) (limited to 'projects') diff --git a/projects/Geany/raylib.c.tags b/projects/Geany/raylib.c.tags index b6ba63dd..33864ca0 100644 --- a/projects/Geany/raylib.c.tags +++ b/projects/Geany/raylib.c.tags @@ -1,29 +1,41 @@ # format=pipe -RaylibIsAwesome|SuperStefkaGeanyTags|OpenSourceHaveFun| InitWindow|void|(int width, int height, const char *title);| +WindowShouldClose|bool|(void);| CloseWindow|void|(void);| IsWindowReady|bool|(void);| -WindowShouldClose|bool|(void);| -IsWindowMinimized|bool(void);| +IsWindowMinimized|bool|(void);| +IsWindowResized|bool|(void);| +IsWindowHidden|bool|(void);| ToggleFullscreen|void|(void);| +UnhideWindow|void|(void);| +HideWindow|void|(void);| SetWindowIcon|void|(Image image);| SetWindowTitle|void|(const char *title);| SetWindowPosition|void|(int x, int y);| SetWindowMonitor|void|(int monitor);| SetWindowMinSize|void|(int width, int height);| SetWindowSize|void|(int width, int height);| +GetWindowHandle|void *|(void);| GetScreenWidth|int|(void);| GetScreenHeight|int|(void);| +GetMonitorCount|int|(void);| +GetMonitorWidth|int|(int monitor);| +GetMonitorHeight|int|(int monitor);| +GetMonitorPhysicalWidth|int|(int monitor);| +GetMonitorPhysicalHeight|int|(int monitor);| +GetMonitorName|const char *|(int monitor);| +GetClipboardText|const char *|(void);| +SetClipboardText|void|(const char *text);| ShowCursor|void|(void);| HideCursor|void|(void);| IsCursorHidden|bool|(void);| -EnableCursor|void|(void); +EnableCursor|void|(void);| DisableCursor|void|(void);| ClearBackground|void|(Color color);| BeginDrawing|void|(void);| EndDrawing|void|(void);| BeginMode2D|void|(Camera2D camera);| -EndMode2D|void|(void); +EndMode2D|void|(void);| BeginMode3D|void|(Camera3D camera);| EndMode3D|void|(void);| BeginTextureMode|void|(RenderTexture2D target);| @@ -38,25 +50,33 @@ GetTime|double|(void);| ColorToInt|int|(Color color);| ColorNormalize|Vector4|(Color color);| ColorToHSV|Vector3|(Color color);| +ColorFromHSV|Color|(Vector3 hsv);| GetColor|Color|(int hexValue);| Fade|Color|(Color color, float alpha);| -ShowLogo|void|(void);| SetConfigFlags|void|(unsigned char flags);| -SetTraceLog|void|(unsigned char types);| +SetTraceLogLevel|void|(int logType);| +SetTraceLogExit|void|(int logType);| +SetTraceLogCallback|void|(TraceLogCallback callback);| TraceLog|void|(int logType, const char *text, ...);| TakeScreenshot|void|(const char *fileName);| GetRandomValue|int|(int min, int max);| +FileExists|bool|(const char *fileName);| IsFileExtension|bool|(const char *fileName, const char *ext);| GetExtension|const char *|(const char *fileName);| GetFileName|const char *|(const char *filePath);| +GetFileNameWithoutExt|const char *|(const char *filePath);| GetDirectoryPath|const char *|(const char *fileName);| GetWorkingDirectory|const char *|(void);| +GetDirectoryFiles|char **|(const char *dirPath, int *count);| +ClearDirectoryFiles|void|(void);| ChangeDirectory|bool|(const char *dir);| IsFileDropped|bool|(void);| GetDroppedFiles|char **|(int *count);| ClearDroppedFiles|void|(void);| +GetFileModTime|long|(const char *fileName);| StorageSaveValue|void|(int position, int value);| StorageLoadValue|int|(int position);| +OpenURL|void|(const char *url);| IsKeyPressed|bool|(int key);| IsKeyDown|bool|(int key);| IsKeyReleased|bool|(int key);| @@ -80,7 +100,9 @@ IsMouseButtonUp|bool|(int button);| GetMouseX|int|(void);| GetMouseY|int|(void);| GetMousePosition|Vector2|(void);| -SetMousePosition|void|(Vector2 position);| +SetMousePosition|void|(int x, int y);| +SetMouseOffset|void|(int offsetX, int offsetY);| +SetMouseScale|void|(float scaleX, float scaleY);| GetMouseWheelMove|int|(void);| GetTouchX|int|(void);| GetTouchY|int|(void);| @@ -95,21 +117,25 @@ GetGestureDragAngle|float|(void);| GetGesturePinchVector|Vector2|(void);| GetGesturePinchAngle|float|(void);| SetCameraMode|void|(Camera camera, int mode);| -UpdateCamera|void|(Camera *camera);| +UpdateCamera|void|(Camera *camera);| SetCameraPanControl|void|(int panKey);| SetCameraAltControl|void|(int altKey);| SetCameraSmoothZoomControl|void|(int szKey);| SetCameraMoveControls|void|(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);| DrawPixel|void|(int posX, int posY, Color color);| -DrawPixelV|void|(Vector2 position, Color color); -DrawLine|void|(int startPosX, int startPosY, int endPosX, int endPosY, Color color); +DrawPixelV|void|(Vector2 position, Color color);| +DrawLine|void|(int startPosX, int startPosY, int endPosX, int endPosY, Color color);| DrawLineV|void|(Vector2 startPos, Vector2 endPos, Color color);| DrawLineEx|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);| DrawLineBezier|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);| DrawCircle|void|(int centerX, int centerY, float radius, Color color);| +DrawCircleSector|void|(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);| +DrawCircleSectorLines|void|(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline DrawCircleGradient|void|(int centerX, int centerY, float radius, Color color1, Color color2);| DrawCircleV|void|(Vector2 center, float radius, Color color);| DrawCircleLines|void|(int centerX, int centerY, float radius, Color color);| +DrawRing|void|(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);| +DrawRingLines|void|(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);| DrawRectangle|void|(int posX, int posY, int width, int height, Color color);| DrawRectangleV|void|(Vector2 position, Vector2 size, Color color);| DrawRectangleRec|void|(Rectangle rec, Color color);| @@ -119,11 +145,14 @@ DrawRectangleGradientH|void|(int posX, int posY, int width, int height, Color co DrawRectangleGradientEx|void|(Rectangle rec, Color col1, Color col2, Color col3, Color col4);| DrawRectangleLines|void|(int posX, int posY, int width, int height, Color color);| DrawRectangleLinesEx|void|(Rectangle rec, int lineThick, Color color);| +DrawRectangleRounded|void|(Rectangle rec, float roundness, int segments, Color color);| +DrawRectangleRoundedLines|void|(Rectangle rec, float roundness, int segments, int lineThick, Color color);| DrawTriangle|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);| DrawTriangleLines|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);| DrawPoly|void|(Vector2 center, int sides, float radius, float rotation, Color color);| DrawPolyEx|void|(Vector2 *points, int numPoints, Color color);| DrawPolyExLines|void|(Vector2 *points, int numPoints, Color color);| +SetShapesTexture|void|(Texture2D texture, Rectangle source);| CheckCollisionRecs|bool|(Rectangle rec1, Rectangle rec2);| CheckCollisionCircles|bool|(Vector2 center1, float radius1, Vector2 center2, float radius2);| CheckCollisionCircleRec|bool|(Vector2 center, float radius, Rectangle rec);| @@ -135,10 +164,12 @@ LoadImage|Image|(const char *fileName);| LoadImageEx|Image|(Color *pixels, int width, int height);| LoadImagePro|Image|(void *data, int width, int height, int format);| LoadImageRaw|Image|(const char *fileName, int width, int height, int format, int headerSize);| -ExportImage|void|(const char *fileName, Image image);| +ExportImage|void|(Image image, const char *fileName);| +ExportImageAsCode|void|(Image image, const char *fileName);| LoadTexture|Texture2D|(const char *fileName);| LoadTextureFromImage|Texture2D|(Image image);| -RenderTexture2D LoadRenderTexture(int width, int height);| +LoadTextureCubemap|TextureCubemap|(Image image, int layoutType);| +LoadRenderTexture|RenderTexture2D|(int width, int height);| UnloadImage|void|(Image image);| UnloadTexture|void|(Texture2D texture);| UnloadRenderTexture|void|(RenderTexture2D target);| @@ -146,24 +177,27 @@ GetImageData|Color *|(Image image);| GetImageDataNormalized|Vector4 *|(Image image);| GetPixelDataSize|int|(int width, int height, int format);| GetTextureData|Image|(Texture2D texture);| +GetScreenData|Image|(void);| UpdateTexture|void|(Texture2D texture, const void *pixels);| ImageCopy|Image|(Image image);| ImageToPOT|void|(Image *image, Color fillColor);| ImageFormat|void|(Image *image, int newFormat);| ImageAlphaMask|void|(Image *image, Image alphaMask);| -ImageAlphaClear|void|(Image *image, Color color, float threshold);| +ImageAlphaClear|void|(Image *image, Color color, float threshold); ImageAlphaCrop|void|(Image *image, float threshold);| ImageAlphaPremultiply|void|(Image *image);| ImageCrop|void|(Image *image, Rectangle crop);| ImageResize|void|(Image *image, int newWidth, int newHeight);| -ImageResizeNN|void|(Image *image, int newWidth,int newHeight);| +ImageResizeNN|void|(Image *image, int newWidth,int newHeight);|void| ImageResizeCanvas|void|(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color);| ImageMipmaps|void|(Image *image);| ImageDither|void|(Image *image, int rBpp, int gBpp, int bBpp, int aBpp);| +ImageExtractPalette|Color *|(Image image, int maxPaletteSize, int *extractCount);| ImageText|Image|(const char *text, int fontSize, Color color);| ImageTextEx|Image|(Font font, const char *text, float fontSize, float spacing, Color tint);| ImageDraw|void|(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);| -ImageDrawRectangle|void|(Image *dst, Vector2 position, Rectangle rec, Color color);| +ImageDrawRectangle|void|(Image *dst, Rectangle rec, Color color);| +ImageDrawRectangleLines|void|(Image *dst, Rectangle rec, int thick, Color color);| ImageDrawText|void|(Image *dst, Vector2 position, const char *text, int fontSize, Color color);| ImageDrawTextEx|void|(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color);| ImageFlipVertical|void|(Image *image);| @@ -176,14 +210,14 @@ ImageColorGrayscale|void|(Image *image);| ImageColorContrast|void|(Image *image, float contrast);| ImageColorBrightness|void|(Image *image, int brightness);| ImageColorReplace|void|(Image *image, Color color, Color replace);| -GenImageColor|void|(int width, int height, Color color);| -GenImageGradientV|void|(int width, int height, Color top, Color bottom);| -GenImageGradientH|void|(int width, int height, Color left, Color right);| -GenImageGradientRadial|void|(int width, int height, float density, Color inner, Color outer);| -GenImageChecked|void|(int width, int height, int checksX, int checksY, Color col1, Color col2);| -GenImageWhiteNoise|void|(int width, int height, float factor);| -GenImagePerlinNoise|void|(int width, int height, int offsetX, int offsetY, float scale);| -GenImageCellular|void|(int width, int height, int tileSize);| +GenImageColor|Image|(int width, int height, Color color);| +GenImageGradientV|Image|(int width, int height, Color top, Color bottom);| +GenImageGradientH|Image|(int width, int height, Color left, Color right);| +GenImageGradientRadial|Image|(int width, int height, float density, Color inner, Color outer);| +GenImageChecked|Image|(int width, int height, int checksX, int checksY, Color col1, Color col2);| +GenImageWhiteNoise|Image|(int width, int height, float factor);| +GenImagePerlinNoise|Image|(int width, int height, int offsetX, int offsetY, float scale);| +GenImageCellular|Image|(int width, int height, int tileSize);| GenTextureMipmaps|void|(Texture2D *texture);| SetTextureFilter|void|(Texture2D texture, int filterMode);| SetTextureWrap|void|(Texture2D texture, int wrapMode);| @@ -191,26 +225,44 @@ DrawTexture|void|(Texture2D texture, int posX, int posY, Color tint);| DrawTextureV|void|(Texture2D texture, Vector2 position, Color tint);| DrawTextureEx|void|(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);| DrawTextureRec|void|(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint);| +DrawTextureQuad|void|(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint);| DrawTexturePro|void|(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);| +DrawTextureNPatch|void|(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);| GetFontDefault|Font|(void);| LoadFont|Font|(const char *fileName);| -LoadFontEx|Font|(const char *fileName, int fontSize, int charsCount, int *fontChars);| -LoadFontData|CharInfo *|(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf);| -GenImageFontAtlas|Image|(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod);| +LoadFontEx|Font|(const char *fileName, int fontSize, int *fontChars, int charsCount);| +LoadFontFromImage|Font|(Image image, Color key, int firstChar);| +LoadFontData|CharInfo *|(const char *fileName, int fontSize, int *fontChars, int charsCount, int type);| +GenImageFontAtlas|Image|(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod);| UnloadFont|void|(Font font);| DrawFPS|void|(int posX, int posY);| DrawText|void|(const char *text, int posX, int posY, int fontSize, Color color);| -DrawTextEx|void|(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint);| +DrawTextEx|void|(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint);| +DrawTextRec|void|(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint);| +DrawTextRecEx|void|(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack);| MeasureText|int|(const char *text, int fontSize);| MeasureTextEx|Vector2|(Font font, const char *text, float fontSize, float spacing);| -FormatText|const char *|(const char *text, ...);| -SubText|const char *|(const char *text, int position, int length);| GetGlyphIndex|int|(Font font, int character);| +TextIsEqual|bool|(const char *text1, const char *text2);| +TextLength|unsigned int|(const char *text);| +TextFormat|const char *|(const char *text, ...);| +TextSubtext|const char *|(const char *text, int position, int length);| +TextReplace|const char *|(char *text, const char *replace, const char *by);| +TextInsert|const char *|(const char *text, const char *insert, int position);| +TextJoin|const char *|(const char **textList, int count, const char *delimiter);| +TextSplit|const char **|(const char *text, char delimiter, int *count);| +TextAppend|void|(char *text, const char *append, int *position);| +TextFindIndex|int|(const char *text, const char *find);| +TextToUpper|const char *|(const char *text);| +TextToLower|const char *|(const char *text);| +TextToPascal|const char *|(const char *text);| +TextToInteger|int|(const char *text);| DrawLine3D|void|(Vector3 startPos, Vector3 endPos, Color color);| DrawCircle3D|void|(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);| DrawCube|void|(Vector3 position, float width, float height, float length, Color color);| DrawCubeV|void|(Vector3 position, Vector3 size, Color color);| DrawCubeWires|void|(Vector3 position, float width, float height, float length, Color color);| +DrawCubeWiresV|void|(Vector3 position, Vector3 size, Color color);| DrawCubeTexture|void|(Texture2D texture, Vector3 position, float width, float height, float length, Color color);| DrawSphere|void|(Vector3 centerPos, float radius, Color color);| DrawSphereEx|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);| @@ -224,12 +276,19 @@ DrawGizmo|void|(Vector3 position);| LoadModel|Model|(const char *fileName);| LoadModelFromMesh|Model|(Mesh mesh);| UnloadModel|void|(Model model);| -LoadMesh|Mesh|(const char *fileName);| +LoadMeshes|Mesh *|(const char *fileName, int *meshCount);| +ExportMesh|void|(Mesh mesh, const char *fileName);| UnloadMesh|void|(Mesh *mesh);| -ExportMesh|void|(const char *fileName, Mesh mesh);| -MeshBoundingBox|BoundingBox|(Mesh mesh);| -MeshTangents|void|(Mesh *mesh);| -MeshBinormals|void|(Mesh *mesh);| +LoadMaterials|Material *|(const char *fileName, int *materialCount);| +LoadMaterialDefault|Material|(void);| +UnloadMaterial|void|(Material material);| +SetMaterialTexture|void|(Material *material, int mapType, Texture2D texture);| +SetModelMeshMaterial|void|(Model *model, int meshId, int materialId);| +LoadModelAnimations|ModelAnimation *|(const char *fileName, int *animsCount);| +UpdateModelAnimation|void|(Model model, ModelAnimation anim, int frame);| +UnloadModelAnimation|void|(ModelAnimation anim);| +IsModelAnimationValid|bool|(Model model, ModelAnimation anim);| +GenMeshPoly|Mesh|(int sides, float radius);| GenMeshPlane|Mesh|(float width, float length, int resX, int resZ);| GenMeshCube|Mesh|(float width, float height, float length);| GenMeshSphere|Mesh|(float radius, int rings, int slices);| @@ -239,9 +298,9 @@ GenMeshTorus|Mesh|(float radius, float size, int radSeg, int sides);| GenMeshKnot|Mesh|(float radius, float size, int radSeg, int sides);| GenMeshHeightmap|Mesh|(Image heightmap, Vector3 size);| GenMeshCubicmap|Mesh|(Image cubicmap, Vector3 cubeSize);| -LoadMaterial|Material|(const char *fileName);| -LoadMaterialDefault|Material|(void);| -UnloadMaterial|void|(Material material);| +MeshBoundingBox|BoundingBox|(Mesh mesh);| +MeshTangents|void|(Mesh *mesh);| +MeshBinormals|void|(Mesh *mesh);| DrawModel|void|(Model model, Vector3 position, float scale, Color tint);| DrawModelEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);| DrawModelWires|void|(Model model, Vector3 position, float scale, Color tint);| @@ -250,24 +309,25 @@ DrawBoundingBox|void|(BoundingBox box, Color color);| DrawBillboard|void|(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);| DrawBillboardRec|void|(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);| CheckCollisionSpheres|bool|(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);| -CheckCollisionBoxes|bool|(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2);| -CheckCollisionBoxSphere|bool|(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere);| +CheckCollisionBoxes|bool|(BoundingBox box1, BoundingBox box2);| +CheckCollisionBoxSphere|bool|(BoundingBox box, Vector3 centerSphere, float radiusSphere);| CheckCollisionRaySphere|bool|(Ray ray, Vector3 spherePosition, float sphereRadius);| CheckCollisionRaySphereEx|bool|(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);| -CheckCollisionRayBox|bool|(Ray ray, Vector3 minBBox, Vector3 maxBBox);| +CheckCollisionRayBox|bool|(Ray ray, BoundingBox box);| GetCollisionRayModel|RayHitInfo|(Ray ray, Model *model);| GetCollisionRayTriangle|RayHitInfo|(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);| GetCollisionRayGround|RayHitInfo|(Ray ray, float groundHeight);| LoadText|char *|(const char *fileName);| -LoadShader|Shader|(char *vsFileName, char *fsFileName);| +LoadShader|Shader|(const char *vsFileName, const char *fsFileName);| LoadShaderCode|Shader|(char *vsCode, char *fsCode);| UnloadShader|void|(Shader shader);| GetShaderDefault|Shader|(void);| GetTextureDefault|Texture2D|(void);| GetShaderLocation|int|(Shader shader, const char *uniformName);| -SetShaderValue|void|(Shader shader, int uniformLoc, float *value, int size);| -SetShaderValuei|void|(Shader shader, int uniformLoc, int *value, int size);| +SetShaderValue|void|(Shader shader, int uniformLoc, const void *value, int uniformType);| +SetShaderValueV|void|(Shader shader, int uniformLoc, const void *value, int uniformType, int count);| SetShaderValueMatrix|void|(Shader shader, int uniformLoc, Matrix mat);| +SetShaderValueTexture|void|(Shader shader, int uniformLoc, Texture2D texture);| SetMatrixProjection|void|(Matrix proj);| SetMatrixModelview|void|(Matrix view);| GetMatrixModelview|Matrix|();| @@ -275,11 +335,13 @@ BeginShaderMode|void|(Shader shader);| EndShaderMode|void|(void);| BeginBlendMode|void|(int mode);| EndBlendMode|void|(void);| -GetVrDeviceInfo|VrDeviceInfo|(int vrDeviceType);| -InitVrSimulator|void|(VrDeviceInfo info);| +BeginScissorMode|void|(int x, int y, int width, int height);| +EndScissorMode|void|(void);| +InitVrSimulator|void|(void);| CloseVrSimulator|void|(void);| -IsVrSimulatorReady|bool|(void);| UpdateVrTracking|void|(Camera *camera);| +SetVrConfiguration|void|(VrDeviceInfo info, Shader distortion);| +IsVrSimulatorReady|bool|(void);| ToggleVrMode|void|(void);| BeginVrDrawing|void|(void);| EndVrDrawing|void|(void);| @@ -288,12 +350,14 @@ CloseAudioDevice|void|(void);| IsAudioDeviceReady|bool|(void);| SetMasterVolume|void|(float volume);| LoadWave|Wave|(const char *fileName);| -LoadWaveEx|Wave|(float *data, int sampleCount, int sampleRate, int sampleSize, int channels);| +LoadWaveEx|Wave|(void *data, int sampleCount, int sampleRate, int sampleSize, int channels);| LoadSound|Sound|(const char *fileName);| LoadSoundFromWave|Sound|(Wave wave);| -UpdateSound|void|(Sound sound, void *data, int numSamples);| +UpdateSound|void|(Sound sound, const void *data, int samplesCount);| UnloadWave|void|(Wave wave);| UnloadSound|void|(Sound sound);| +ExportWave|void|(Wave wave, const char *fileName);| +ExportWaveAsCode|void|(Wave wave, const char *fileName);| PlaySound|void|(Sound sound);| PauseSound|void|(Sound sound);| ResumeSound|void|(Sound sound);| @@ -315,27 +379,31 @@ ResumeMusicStream|void|(Music music);| IsMusicPlaying|bool|(Music music);| SetMusicVolume|void|(Music music, float volume);| SetMusicPitch|void|(Music music, float pitch);| -SetMusicLoopCount|void|(Music music, float count);| +SetMusicLoopCount|void|(Music music, int count);| GetMusicTimeLength|float|(Music music);| GetMusicTimePlayed|float|(Music music);| InitAudioStream|AudioStream|(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels);| -UpdateAudioStream|void|(AudioStream stream, void *data, int numSamples);| +UpdateAudioStream|void|(AudioStream stream, const void *data, int samplesCount);| CloseAudioStream|void|(AudioStream stream);| IsAudioBufferProcessed|bool|(AudioStream stream);| PlayAudioStream|void|(AudioStream stream);| PauseAudioStream|void|(AudioStream stream);| ResumeAudioStream|void|(AudioStream stream);| +IsAudioStreamPlaying|bool|(AudioStream stream);| StopAudioStream|void|(AudioStream stream);| -Color|struct|| -Rectangle|struct|| +SetAudioStreamVolume|void|(AudioStream stream, float volume);| +SetAudioStreamPitch|void|(AudioStream stream, float pitch);| Vector2|struct|| Vector3|struct|| Vector4|struct|| Quaternion|struct|| Matrix|struct|| +Color|struct|| +Rectangle|struct|| Image|struct|| Texture|struct|| RenderTexture|struct|| +NPatchInfo|struct|| CharInfo|struct|| Font|struct|| Camera|struct|| @@ -345,12 +413,17 @@ Shader|struct|| MaterialMap|struct|| Material|struct|| Model|struct|| +Transform|struct|| +BoneInfo|struct|| +ModelAnimation|struct|| Ray|struct|| RayHitInfo|struct|| +BoundingBox|struct|| Wave|struct|| Sound|struct|| Music|struct|| AudioStream|struct|| +VrDeviceInfo|struct|| LIGHTGRAY|#define|| GRAY|#define|| DARKGRAY|#define|| @@ -377,4 +450,3 @@ BLACK|#define|| BLANK|#define|| MAGENTA|#define|| RAYWHITE|#define|| - -- cgit v1.2.3 From df7a0582160537f3962a6ab46e1dadc034f56458 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 5 Jun 2019 00:04:31 +0200 Subject: Review projects paths --- projects/4coder/Makefile | 4 ++-- projects/CodeBlocks/core_basic_window.cbp | 8 ++++---- projects/Geany/raylib_compile_execute.bat | 4 ++-- projects/Geany/raylib_compile_sources.bat | 6 +++--- projects/VSCode/.vscode/c_cpp_properties.json | 2 +- projects/VSCode/.vscode/launch.json | 4 ++-- projects/VSCode/.vscode/tasks.json | 4 ++-- projects/VSCode/Makefile | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) (limited to 'projects') diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index 63d093a2..a00f4fab 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -27,7 +27,7 @@ PROJECT_NAME ?= game RAYLIB_VERSION ?= 2.5.0 RAYLIB_API_VERSION ?= 2 -RAYLIB_PATH ?= C:\GitHub\raylib +RAYLIB_PATH ?= ..\.. # Define default options @@ -200,7 +200,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resource file contains windows executable icon and properties # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) ifeq ($(RAYLIB_LIBTYPE),STATIC) diff --git a/projects/CodeBlocks/core_basic_window.cbp b/projects/CodeBlocks/core_basic_window.cbp index 0000860f..c4b22a9e 100644 --- a/projects/CodeBlocks/core_basic_window.cbp +++ b/projects/CodeBlocks/core_basic_window.cbp @@ -13,11 +13,11 @@ Application true - v142 + $(DefaultPlatformToolset) Unicode Application true - v142 + $(DefaultPlatformToolset) Unicode Application false - v142 + $(DefaultPlatformToolset) true Unicode Application false - v142 + $(DefaultPlatformToolset) true Unicode @@ -107,7 +107,7 @@ kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -127,7 +127,7 @@ kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -152,7 +152,7 @@ $(SolutionDir)deps;%(AdditionalLibraryDirectories) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -177,7 +177,7 @@ %(AdditionalLibraryDirectories) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q diff --git a/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj index fcbc6bfd..729f07ff 100644 --- a/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj @@ -22,33 +22,33 @@ {B655E850-3322-42F7-941D-6AC18FD66CA1} Win32Proj raylib_example_cpp - 10.0 + 10.0.17763.0 core_basic_window_cpp Application true - v142 + $(DefaultPlatformToolset) Unicode Application true - v142 + $(DefaultPlatformToolset) Unicode Application false - v142 + $(DefaultPlatformToolset) true Unicode Application false - v142 + $(DefaultPlatformToolset) true Unicode @@ -107,7 +107,7 @@ $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -127,7 +127,7 @@ $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -151,7 +151,7 @@ kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -175,7 +175,7 @@ kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q diff --git a/projects/VS2017.ANGLE/raylib/raylib.vcxproj b/projects/VS2017.ANGLE/raylib/raylib.vcxproj index b1cf67b9..e6d66e3b 100644 --- a/projects/VS2017.ANGLE/raylib/raylib.vcxproj +++ b/projects/VS2017.ANGLE/raylib/raylib.vcxproj @@ -22,32 +22,32 @@ {E89D61AC-55DE-4482-AFD4-DF7242EBC859} Win32Proj raylib - 10.0 + 10.0.17763.0 StaticLibrary true - v142 + $(DefaultPlatformToolset) Unicode DynamicLibrary true - v142 + $(DefaultPlatformToolset) Unicode StaticLibrary false - v142 + $(DefaultPlatformToolset) true Unicode DynamicLibrary false - v142 + $(DefaultPlatformToolset) true Unicode diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj index fe97faac..8296b654 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj @@ -42,13 +42,13 @@ Application true - v141 + $(DefaultPlatformToolset) Application false true - v140 + $(DefaultPlatformToolset) diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj index f05f829c..6dd20096 100644 --- a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj @@ -68,35 +68,35 @@ StaticLibrary true - v141 + $(DefaultPlatformToolset) StaticLibrary true - v141 + $(DefaultPlatformToolset) StaticLibrary true - v141 + $(DefaultPlatformToolset) StaticLibrary false true - v141 + $(DefaultPlatformToolset) StaticLibrary false true - v141 + $(DefaultPlatformToolset) StaticLibrary false true - v141 + $(DefaultPlatformToolset) diff --git a/projects/VS2017/examples/core_basic_window.vcxproj b/projects/VS2017/examples/core_basic_window.vcxproj index 0348589f..38247bee 100644 --- a/projects/VS2017/examples/core_basic_window.vcxproj +++ b/projects/VS2017/examples/core_basic_window.vcxproj @@ -29,26 +29,26 @@ Application true - v141 + $(DefaultPlatformToolset) Unicode Application true - v141 + $(DefaultPlatformToolset) Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index 6ade272d..3e3f790f 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -29,26 +29,26 @@ Application true - v141 + $(DefaultPlatformToolset) Unicode Application true - v141 + $(DefaultPlatformToolset) Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode diff --git a/projects/VS2017/raylib/raylib.vcxproj b/projects/VS2017/raylib/raylib.vcxproj index 3ff77104..82703397 100644 --- a/projects/VS2017/raylib/raylib.vcxproj +++ b/projects/VS2017/raylib/raylib.vcxproj @@ -28,26 +28,26 @@ StaticLibrary true - v141 + $(DefaultPlatformToolset) Unicode DynamicLibrary true - v141 + $(DefaultPlatformToolset) Unicode StaticLibrary false - v141 + $(DefaultPlatformToolset) true Unicode DynamicLibrary false - v141 + $(DefaultPlatformToolset) true Unicode -- cgit v1.2.3 From eb1b2535f6ef5f5adb609f5e8741b20c633e15de Mon Sep 17 00:00:00 2001 From: Mohamed Shazan Date: Thu, 6 Jun 2019 16:44:37 +0530 Subject: Change ANGLE binaries location --- .../VS2017.ANGLE/examples/core_basic_window.vcxproj | 4 ++-- .../examples/core_basic_window_cpp.vcxproj | 4 ++-- projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll | Bin 0 -> 4493352 bytes projects/VS2017.ANGLE/lib/x64/libEGL.dll | Bin 0 -> 62976 bytes projects/VS2017.ANGLE/lib/x64/libEGL.lib | Bin 0 -> 14164 bytes projects/VS2017.ANGLE/lib/x64/libGLESv2.dll | Bin 0 -> 18712576 bytes projects/VS2017.ANGLE/lib/x64/libGLESv2.lib | Bin 0 -> 548600 bytes projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll | Bin 0 -> 3705472 bytes projects/VS2017.ANGLE/lib/x86/libEGL.dll | Bin 0 -> 51712 bytes projects/VS2017.ANGLE/lib/x86/libEGL.lib | Bin 0 -> 14992 bytes projects/VS2017.ANGLE/lib/x86/libGLESv2.dll | Bin 0 -> 16666624 bytes projects/VS2017.ANGLE/lib/x86/libGLESv2.lib | Bin 0 -> 575538 bytes projects/VS2017.ANGLE/raylib/raylib.vcxproj | 4 ++-- 13 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll create mode 100644 projects/VS2017.ANGLE/lib/x64/libEGL.dll create mode 100644 projects/VS2017.ANGLE/lib/x64/libEGL.lib create mode 100644 projects/VS2017.ANGLE/lib/x64/libGLESv2.dll create mode 100644 projects/VS2017.ANGLE/lib/x64/libGLESv2.lib create mode 100644 projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll create mode 100644 projects/VS2017.ANGLE/lib/x86/libEGL.dll create mode 100644 projects/VS2017.ANGLE/lib/x86/libEGL.lib create mode 100644 projects/VS2017.ANGLE/lib/x86/libGLESv2.dll create mode 100644 projects/VS2017.ANGLE/lib/x86/libGLESv2.lib (limited to 'projects') diff --git a/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj index d9bd0618..cf7b42aa 100644 --- a/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj +++ b/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj @@ -107,7 +107,7 @@ kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -152,7 +152,7 @@ $(SolutionDir)deps;%(AdditionalLibraryDirectories) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q diff --git a/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj index 729f07ff..72ead7ad 100644 --- a/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj @@ -107,7 +107,7 @@ $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q @@ -151,7 +151,7 @@ kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q diff --git a/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll b/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll new file mode 100644 index 00000000..47040da0 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll differ diff --git a/projects/VS2017.ANGLE/lib/x64/libEGL.dll b/projects/VS2017.ANGLE/lib/x64/libEGL.dll new file mode 100644 index 00000000..71c20a7a Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libEGL.dll differ diff --git a/projects/VS2017.ANGLE/lib/x64/libEGL.lib b/projects/VS2017.ANGLE/lib/x64/libEGL.lib new file mode 100644 index 00000000..b440f78c Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libEGL.lib differ diff --git a/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll b/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll new file mode 100644 index 00000000..66fcba06 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll differ diff --git a/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib b/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib new file mode 100644 index 00000000..af5ba5ad Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib differ diff --git a/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll b/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll new file mode 100644 index 00000000..4ffad2d7 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll differ diff --git a/projects/VS2017.ANGLE/lib/x86/libEGL.dll b/projects/VS2017.ANGLE/lib/x86/libEGL.dll new file mode 100644 index 00000000..a9cb4a9a Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libEGL.dll differ diff --git a/projects/VS2017.ANGLE/lib/x86/libEGL.lib b/projects/VS2017.ANGLE/lib/x86/libEGL.lib new file mode 100644 index 00000000..1954ceb3 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libEGL.lib differ diff --git a/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll b/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll new file mode 100644 index 00000000..47a71ff7 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll differ diff --git a/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib b/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib new file mode 100644 index 00000000..562310cc Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib differ diff --git a/projects/VS2017.ANGLE/raylib/raylib.vcxproj b/projects/VS2017.ANGLE/raylib/raylib.vcxproj index e6d66e3b..5c97eb60 100644 --- a/projects/VS2017.ANGLE/raylib/raylib.vcxproj +++ b/projects/VS2017.ANGLE/raylib/raylib.vcxproj @@ -97,7 +97,7 @@ Windows - $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget);%(AdditionalLibraryDirectories) + $(SolutionDir)lib\$(PlatformTarget);%(AdditionalLibraryDirectories) libEGL.lib;libGLESv2.lib @@ -137,7 +137,7 @@ true - $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget);%(AdditionalLibraryDirectories) + $(SolutionDir)lib\$(PlatformTarget);%(AdditionalLibraryDirectories) libEGL.lib;libGLESv2.lib -- cgit v1.2.3