From ec33e7d705e301eb2b74a841e823907295caa37a Mon Sep 17 00:00:00 2001 From: Ray San Date: Fri, 4 May 2018 16:59:48 +0200 Subject: BREAKING CHANGE: Renamed SpriteFont type to Font - Preparing MP3 files support - Jumped version to raylib 2.0-dev (too many breaking changes...) --- release/include/raylib.h | 110 ++++++++++++++++----------------- release/libs/win32/mingw32/libraylib.a | Bin 1056510 -> 1218614 bytes 2 files changed, 54 insertions(+), 56 deletions(-) (limited to 'release') diff --git a/release/include/raylib.h b/release/include/raylib.h index acca46bd..e83650e6 100644 --- a/release/include/raylib.h +++ b/release/include/raylib.h @@ -1,14 +1,12 @@ /********************************************************************************************** * -* raylib v1.9.6-dev -* -* A simple and easy-to-use library to learn videogames programming (www.raylib.com) +* raylib - A simple and easy-to-use library to learn videogames programming (www.raylib.com) * * FEATURES: * - Written in plain C code (C99) in PascalCase/camelCase notation * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile) * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] -* - Powerful fonts module with SpriteFonts support (XNA fonts, AngelCode fonts, TTF) +* - Powerful fonts module with Fonts support (XNA fonts, AngelCode fonts, TTF) * - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) * - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! * - Flexible Materials system, supporting classic maps and PBR maps @@ -138,6 +136,9 @@ #define KEY_RIGHT_SHIFT 344 #define KEY_RIGHT_CONTROL 345 #define KEY_RIGHT_ALT 346 +#define KEY_GRAVE 96 +#define KEY_SLASH 47 +#define KEY_BACKSLASH 92 // Keyboard Alpha Numeric Keys #define KEY_ZERO 48 @@ -189,7 +190,7 @@ #define MOUSE_MIDDLE_BUTTON 2 // Touch points registered -#define MAX_TOUCH_POINTS 2 +#define MAX_TOUCH_POINTS 2 // Gamepad Number #define GAMEPAD_PLAYER1 0 @@ -348,10 +349,10 @@ typedef struct Color { // Rectangle type typedef struct Rectangle { - int x; - int y; - int width; - int height; + float x; + float y; + float width; + float height; } Rectangle; // Image type, bpp always RGBA (32bit) @@ -381,7 +382,7 @@ typedef struct RenderTexture2D { Texture2D depth; // Depth buffer attachment texture } RenderTexture2D; -// SpriteFont character info +// Font character info typedef struct CharInfo { int value; // Character value (Unicode) Rectangle rec; // Character rectangle in sprite font @@ -390,28 +391,26 @@ typedef struct CharInfo { int advanceX; // Character advance position X } CharInfo; -// SpriteFont type, includes texture and charSet array data -typedef struct SpriteFont { +// Font type, includes texture and charSet array data +typedef struct Font { Texture2D texture; // Font texture int baseSize; // Base size (default chars height) int charsCount; // Number of characters CharInfo *chars; // Characters info data -} SpriteFont; +} Font; -// Camera projection modes -typedef enum { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC -} CameraType; +#define SpriteFont Font // SpriteFont type fallback, defaults to Font // Camera type, defines a camera position/orientation in 3d space -typedef struct Camera { +typedef struct Camera3D { Vector3 position; // Camera position Vector3 target; // Camera target it looks-at Vector3 up; // Camera up vector (rotation over its axis) float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - CameraType type; // Camera type, controlling projection type, either CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC. -} Camera; + int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC +} Camera3D; + +#define Camera Camera3D // Camera type fallback, defaults to Camera3D // Camera2D type, defines a 2d camera typedef struct Camera2D { @@ -675,6 +674,12 @@ typedef enum { CAMERA_THIRD_PERSON } CameraMode; +// Camera projection modes +typedef enum { + CAMERA_PERSPECTIVE = 0, + CAMERA_ORTHOGRAPHIC +} CameraType; + // Head Mounted Display devices typedef enum { HMD_DEFAULT_DEVICE = 0, @@ -725,15 +730,15 @@ RLAPI void DisableCursor(void); // Disables cu RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) -RLAPI void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera (2D) -RLAPI void End2dMode(void); // Ends 2D mode with custom camera -RLAPI void Begin3dMode(Camera camera); // Initializes 3D mode with custom camera (3D) -RLAPI void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode +RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D) +RLAPI void EndMode2D(void); // Ends 2D mode with custom camera +RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D) +RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing RLAPI void EndTextureMode(void); // Ends drawing to render texture // Screen-space-related functions -RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) @@ -744,8 +749,8 @@ RLAPI float GetFrameTime(void); // Returns tim RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() // Color-related functions -RLAPI float *ColorToFloat(Color color); // Returns normalized float array for a Color 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 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 @@ -836,9 +841,7 @@ RLAPI void UpdateCamera(Camera *camera); // Update came RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) -RLAPI void SetCameraMoveControls(int frontKey, int backKey, - int rightKey, int leftKey, - int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) +RLAPI void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) @@ -888,6 +891,7 @@ 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 Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) @@ -898,7 +902,6 @@ RLAPI Color *GetImageData(Image image); 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 void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data -RLAPI void SaveImageAs(const char *fileName, Image image); // Save image to a PNG file // Image manipulation functions RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) @@ -914,11 +917,11 @@ RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); 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 Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint); // Create an image from text (custom sprite 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 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, SpriteFont font, const char *text, - float fontSize, int spacing, Color color); // Draw text (custom sprite 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 RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint @@ -947,31 +950,30 @@ 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, // Draw a part of a texture defined by a rectangle with 'pro' parameters - float rotation, Color tint); +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 + //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) //------------------------------------------------------------------------------------ -// SpriteFont loading/unloading functions -RLAPI SpriteFont GetDefaultFont(void); // Get the default SpriteFont -RLAPI SpriteFont LoadSpriteFont(const char *fileName); // Load SpriteFont from file into GPU memory (VRAM) -RLAPI SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load SpriteFont from file with extended parameters -RLAPI void UnloadSpriteFont(SpriteFont font); // Unload SpriteFont from GPU memory (VRAM) +// Font loading/unloading functions +RLAPI Font GetDefaultFont(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 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(SpriteFont font, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters - float fontSize, int spacing, Color tint); +RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters // Text misc. functions RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font -RLAPI Vector2 MeasureTextEx(SpriteFont font, const char *text, float fontSize, int spacing); // Measure string size for SpriteFont +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(SpriteFont font, int character); // Returns index position for a unicode character on sprite font +RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) @@ -1007,6 +1009,7 @@ RLAPI void UnloadModel(Model model); // Mesh loading/unloading functions RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from 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 @@ -1031,25 +1034,21 @@ RLAPI void UnloadMaterial(Material material); // Model drawing functions RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, - float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, - float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, - Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec // Collision detection functions RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere -RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, - Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point +RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box -RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh); // Get collision info between ray and mesh +RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model *model); // Get collision info between ray and model RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) @@ -1148,8 +1147,7 @@ RLAPI float GetMusicTimeLength(Music music); // Get mus RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) // AudioStream management functions -RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, - unsigned int channels); // Init audio stream (to stream raw audio pcm data) +RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill diff --git a/release/libs/win32/mingw32/libraylib.a b/release/libs/win32/mingw32/libraylib.a index 361aa73c..b188e329 100644 Binary files a/release/libs/win32/mingw32/libraylib.a and b/release/libs/win32/mingw32/libraylib.a differ -- cgit v1.2.3 From aa76985c0da1dab965b41c98e87db341c73e9538 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 11 May 2018 18:14:19 +0200 Subject: Review raylib version to 2.0 Review raylib_icon resource --- .gitignore | 1 - examples/Makefile | 4 ++-- release/libs/win32/mingw32/libraylib.a | Bin 1218614 -> 1100766 bytes src/CMakeLists.txt | 2 +- src/Makefile | 2 +- src/raylib.rc | 14 +++++++------- src/raylib_icon | Bin 0 -> 107340 bytes src/resources | Bin 107260 -> 0 bytes templates/advance_game/Makefile | 2 +- templates/simple_game/Makefile | 2 +- templates/standard_game/Makefile | 2 +- 11 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 src/raylib_icon delete mode 100644 src/resources (limited to 'release') diff --git a/.gitignore b/.gitignore index 1b4d5e41..6caeaead 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,6 @@ ipch/ # Ignore compiled binaries *.o *.exe -!tools/rREM/rrem.exe # Ignore all examples files examples/* diff --git a/examples/Makefile b/examples/Makefile index becb91dc..d283e807 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -25,7 +25,7 @@ # Define required raylib variables PROJECT_NAME ?= raylib_examples -RAYLIB_VERSION ?= 1.9.7 +RAYLIB_VERSION ?= 2.0.0 RAYLIB_API_VERSION ?= 1 RAYLIB_PATH ?= .. @@ -207,7 +207,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) ifeq ($(RAYLIB_BUILD_MODE),DEBUG) diff --git a/release/libs/win32/mingw32/libraylib.a b/release/libs/win32/mingw32/libraylib.a index b188e329..3aac1c0c 100644 Binary files a/release/libs/win32/mingw32/libraylib.a and b/release/libs/win32/mingw32/libraylib.a differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 98b6b0e9..e6501dc5 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ project(raylib) include(GNUInstallDirs) -set(PROJECT_VERSION 1.9.7) +set(PROJECT_VERSION 2.0.0) set(API_VERSION 1) set(RAYLIB raylib) # Name of the generated library diff --git a/src/Makefile b/src/Makefile index 8444ed57..67d7c8c2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,7 +42,7 @@ .PHONY: all clean install uninstall # Define required raylib variables -RAYLIB_VERSION = 1.9.7 +RAYLIB_VERSION = 2.0.0 RAYLIB_API_VERSION = 1 # See below for alternatives. diff --git a/src/raylib.rc b/src/raylib.rc index 89eb8e34..ee2a5fab 100644 --- a/src/raylib.rc +++ b/src/raylib.rc @@ -1,22 +1,22 @@ GLFW_ICON ICON "raylib.ico" 1 VERSIONINFO -FILEVERSION 1,8,0,0 -PRODUCTVERSION 1,8,0,0 +FILEVERSION 2,0,0,0 +PRODUCTVERSION 2,0,0,0 BEGIN BLOCK "StringFileInfo" BEGIN //BLOCK "080904E4" // English UK BLOCK "040904E4" // English US BEGIN - //VALUE "CompanyName", "My Company Name" + VALUE "CompanyName", "raylib technologies" VALUE "FileDescription", "Created using raylib (www.raylib.com)" - VALUE "FileVersion", "1.8.0" - VALUE "InternalName", "raylib" - VALUE "LegalCopyright", "(c) 2017 Ramon Santamaria - @raysan5" + VALUE "FileVersion", "2.0.0" + VALUE "InternalName", "raylib app" + VALUE "LegalCopyright", "(c) 2018 Ramon Santamaria - @raysan5" //VALUE "OriginalFilename", "raylib_app.exe" VALUE "ProductName", "raylib game" - VALUE "ProductVersion", "1.8.0" + VALUE "ProductVersion", "2.0.0" END END BLOCK "VarFileInfo" diff --git a/src/raylib_icon b/src/raylib_icon new file mode 100644 index 00000000..f6e32f37 Binary files /dev/null and b/src/raylib_icon differ diff --git a/src/resources b/src/resources deleted file mode 100644 index ca725042..00000000 Binary files a/src/resources and /dev/null differ diff --git a/templates/advance_game/Makefile b/templates/advance_game/Makefile index a363e606..181f9dfb 100644 --- a/templates/advance_game/Makefile +++ b/templates/advance_game/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/templates/simple_game/Makefile b/templates/simple_game/Makefile index 0de3082b..4cd435ea 100644 --- a/templates/simple_game/Makefile +++ b/templates/simple_game/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE diff --git a/templates/standard_game/Makefile b/templates/standard_game/Makefile index 4ca1edd4..e18703b2 100644 --- a/templates/standard_game/Makefile +++ b/templates/standard_game/Makefile @@ -160,7 +160,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window - CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows + CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows endif ifeq ($(PLATFORM_OS),LINUX) CFLAGS += -no-pie -D_DEFAULT_SOURCE -- cgit v1.2.3 From fb4265f64659a50a5a86f9f283e7468b7998c60f Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 17 May 2018 00:59:53 +0200 Subject: Reviewed Android pipeline Now defaults to Clang, ARM64 and API 21 --- release/libs/android/arm64-v8a/libraylib.a | Bin 0 -> 981332 bytes src/Makefile | 17 ++++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 release/libs/android/arm64-v8a/libraylib.a (limited to 'release') diff --git a/release/libs/android/arm64-v8a/libraylib.a b/release/libs/android/arm64-v8a/libraylib.a new file mode 100644 index 00000000..0e252902 Binary files /dev/null and b/release/libs/android/arm64-v8a/libraylib.a differ diff --git a/src/Makefile b/src/Makefile index 67d7c8c2..582daf49 100644 --- a/src/Makefile +++ b/src/Makefile @@ -163,10 +163,10 @@ endif ifeq ($(PLATFORM),PLATFORM_ANDROID) # Android required path variables ANDROID_NDK = C:/android-ndk - ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16 + ANDROID_TOOLCHAIN = C:/android_toolchain_arm64_api21 # Android architecture: ARM or ARM64 - ANDROID_ARCH ?= ARM + ANDROID_ARCH ?= ARM64 endif # RAYLIB_RELEASE_PATH points to provided binaries or your immediate build of raylib. @@ -251,12 +251,11 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif ifeq ($(PLATFORM),PLATFORM_ANDROID) # Android toolchain (must be provided for desired architecture and compiler) - # NOTE: gcc compiler is being deprecated in Android NDK r16 ifeq ($(ANDROID_ARCH),ARM) - CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-gcc + CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang endif ifeq ($(ANDROID_ARCH),ARM64) - CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-gcc + CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang endif endif @@ -316,15 +315,15 @@ ifeq ($(PLATFORM),PLATFORM_WEB) CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling endif ifeq ($(PLATFORM),PLATFORM_ANDROID) - # Compiler flags for arquitecture - CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 + # Compiler flags for arquitecture (only ARM, not ARM64) + #CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 # Compilation functions attributes options - CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC + CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC # Compiler options for the linker # -Werror=format-security CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes # Preprocessor macro definitions - CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=16 + CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21 endif # Define required compilation flags for raylib SHARED lib -- cgit v1.2.3 From 8e0cd51afb50bcc7b96fc0530c74dc7210b0138d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 20 May 2018 18:49:58 +0200 Subject: Support shared library building on Android --- release/libs/android/arm64-v8a/libraylib.a | Bin 981332 -> 982394 bytes release/libs/android/arm64-v8a/libraylib.so | Bin 0 -> 553384 bytes src/Makefile | 5 ++++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 release/libs/android/arm64-v8a/libraylib.so (limited to 'release') diff --git a/release/libs/android/arm64-v8a/libraylib.a b/release/libs/android/arm64-v8a/libraylib.a index 0e252902..76656402 100644 Binary files a/release/libs/android/arm64-v8a/libraylib.a and b/release/libs/android/arm64-v8a/libraylib.a differ diff --git a/release/libs/android/arm64-v8a/libraylib.so b/release/libs/android/arm64-v8a/libraylib.so new file mode 100644 index 00000000..04e53f03 Binary files /dev/null and b/release/libs/android/arm64-v8a/libraylib.so differ diff --git a/src/Makefile b/src/Makefile index d327c2d1..ae0265c9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -383,11 +383,13 @@ endif # Define linker options ifeq ($(PLATFORM),PLATFORM_ANDROID) LDFLAGS = -Wl,-soname,libraylib.$(API_VERSION).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 + LDFLAGS += -Wl,--build-id -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. -Lsrc -L$(RAYLIB_RELEASE_PATH) + # Avoid unresolved symbol pointing to external main() + LDFLAGS += -Wl,-undefined,dynamic_lookup LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -latomic -lc -lm endif @@ -473,6 +475,7 @@ else ifeq ($(PLATFORM),PLATFORM_ANDROID) $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS) @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" + # WARNING: symbolic links creation on Windows should be done using mklink command, no ln available cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so endif -- cgit v1.2.3 From a752092055ca7c6c3d9d2b74d6ab212db14d0909 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 20 May 2018 19:13:10 +0200 Subject: Removed 32bit arm Android library From 2019 64bit support will be mandatory to publish an Android app. Google plans to require that new apps target Oreo (API level 26) in August of 2018. --- release/libs/android/armeabi-v7a/libraylib.a | Bin 883994 -> 0 bytes release/libs/android/armeabi-v7a/libraylib.so | Bin 477808 -> 0 bytes src/Makefile | 15 ++------------- templates/advance_game/Makefile.Android | 24 ++++++++++++------------ templates/simple_game/Makefile.Android | 22 +++++++++++----------- templates/standard_game/Makefile.Android | 25 +++++++++++++------------ 6 files changed, 38 insertions(+), 48 deletions(-) delete mode 100644 release/libs/android/armeabi-v7a/libraylib.a delete mode 100644 release/libs/android/armeabi-v7a/libraylib.so (limited to 'release') diff --git a/release/libs/android/armeabi-v7a/libraylib.a b/release/libs/android/armeabi-v7a/libraylib.a deleted file mode 100644 index 1e6a0088..00000000 Binary files a/release/libs/android/armeabi-v7a/libraylib.a and /dev/null differ diff --git a/release/libs/android/armeabi-v7a/libraylib.so b/release/libs/android/armeabi-v7a/libraylib.so deleted file mode 100644 index d90a30c5..00000000 Binary files a/release/libs/android/armeabi-v7a/libraylib.so and /dev/null differ diff --git a/src/Makefile b/src/Makefile index ae0265c9..f8219044 100644 --- a/src/Makefile +++ b/src/Makefile @@ -165,7 +165,8 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) ANDROID_NDK = C:/android-ndk ANDROID_TOOLCHAIN = C:/android_toolchain_arm64_api21 - # Android architecture: ARM or ARM64 + # Android architecture: ARM64 + # Starting at 2019 using ARM64 is mandatory for published apps ANDROID_ARCH ?= ARM64 endif @@ -195,9 +196,6 @@ ifeq ($(PLATFORM),PLATFORM_WEB) RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5 endif ifeq ($(PLATFORM),PLATFORM_ANDROID) - ifeq ($(ANDROID_ARCH),ARM) - RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/android/armeabi-v7a - endif ifeq ($(ANDROID_ARCH),ARM64) RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/android/arm64-v8a endif @@ -251,9 +249,6 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif ifeq ($(PLATFORM),PLATFORM_ANDROID) # Android toolchain (must be provided for desired architecture and compiler) - ifeq ($(ANDROID_ARCH),ARM) - CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang - endif ifeq ($(ANDROID_ARCH),ARM64) CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang endif @@ -272,9 +267,6 @@ endif # Android archiver (also depends on desired architecture) ifeq ($(PLATFORM),PLATFORM_ANDROID) - ifeq ($(ANDROID_ARCH),ARM) - AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar - endif ifeq ($(ANDROID_ARCH),ARM64) AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar endif @@ -430,9 +422,6 @@ all: raylib # NOTE: Android toolchain could already be provided generate_android_toolchain: ifeq ($(PLATFORM),PLATFORM_ANDROID) - ifeq ($(ANDROID_ARCH),ARM) - $(ANDROID_NDK)/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.9 --use-llvm --install-dir=$(ANDROID_TOOLCHAIN) - endif ifeq ($(ANDROID_ARCH),ARM64) $(ANDROID_NDK)/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=aarch64-linux-androideabi-4.9 --use-llvm --install-dir=$(ANDROID_TOOLCHAIN) endif diff --git a/templates/advance_game/Makefile.Android b/templates/advance_game/Makefile.Android index f082ab23..af23f4a3 100644 --- a/templates/advance_game/Makefile.Android +++ b/templates/advance_game/Makefile.Android @@ -29,7 +29,7 @@ RAYLIB_PATH ?= ..\.. # NOTE: JAVA_HOME must be set to JDK ANDROID_HOME = C:/android-sdk ANDROID_NDK = C:/android-ndk -ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16 +ANDROID_TOOLCHAIN = C:/android_toolchain_arm64_api21 ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/26.0.2 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools JAVA_HOME = C:/PROGRA~1/Java/jdk1.8.0_144 @@ -61,21 +61,21 @@ 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\armeabi-v7a +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\arm64-v8a # 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/armeabi-v7a/libraylib.so + PROJECT_SHARED_LIBS = lib/arm64-v8a/libraylib.so endif # Compiler and archiver # NOTE: GCC is being deprectated in Android NDK r16 -CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-gcc -AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar +CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang +AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar # Compiler flags for arquitecture -CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 +CFLAGS = -std=c99 -march=arm64-v8a # Compilation functions attributes options CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC # Compiler options for the linker @@ -92,7 +92,7 @@ LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl # 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/armeabi-v7a +LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/arm64-v8a # Define any libraries to link into executable # if you want to link libraries (libname.so or libname.a), use the -lname @@ -127,7 +127,7 @@ create_temp_project_dirs: 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\armeabi-v7a mkdir $(PROJECT_BUILD_PATH)\lib\armeabi-v7a + if not exist $(PROJECT_BUILD_PATH)\lib\arm64-v8a mkdir $(PROJECT_BUILD_PATH)\lib\arm64-v8a 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 @@ -147,10 +147,10 @@ endef # 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\armeabi-v7a\libraylib.so + copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\arm64-v8a\libraylib.so endif ifeq ($(RAYLIB_LIBTYPE),STATIC) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libraylib.a + copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\arm64-v8a\libraylib.a endif # Copy project required resources: strings.xml, icon.png, assets @@ -219,7 +219,7 @@ compile_native_app_glue: # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so compile_project_code: $(OBJS) - $(CC) -o $(PROJECT_BUILD_PATH)/lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) + $(CC) -o $(PROJECT_BUILD_PATH)/lib/arm64-v8a/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 @@ -240,7 +240,7 @@ compile_project_class_dex: # 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-16/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/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) + cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/arm64-v8a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) # Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk sign_project_apk_package: diff --git a/templates/simple_game/Makefile.Android b/templates/simple_game/Makefile.Android index f082ab23..e45293fd 100644 --- a/templates/simple_game/Makefile.Android +++ b/templates/simple_game/Makefile.Android @@ -29,7 +29,7 @@ RAYLIB_PATH ?= ..\.. # NOTE: JAVA_HOME must be set to JDK ANDROID_HOME = C:/android-sdk ANDROID_NDK = C:/android-ndk -ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16 +ANDROID_TOOLCHAIN = C:/android_toolchain_arm64_api21 ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/26.0.2 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools JAVA_HOME = C:/PROGRA~1/Java/jdk1.8.0_144 @@ -61,21 +61,21 @@ 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\armeabi-v7a +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\arm64-v8a # 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/armeabi-v7a/libraylib.so + PROJECT_SHARED_LIBS = lib/arm64-v8a/libraylib.so endif # Compiler and archiver # NOTE: GCC is being deprectated in Android NDK r16 -CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-gcc -AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar +CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang +AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar # Compiler flags for arquitecture -CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 +CFLAGS = -std=c99 -march=arm64-v8a # Compilation functions attributes options CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC # Compiler options for the linker @@ -127,7 +127,7 @@ create_temp_project_dirs: 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\armeabi-v7a mkdir $(PROJECT_BUILD_PATH)\lib\armeabi-v7a + if not exist $(PROJECT_BUILD_PATH)\lib\arm64-v8a mkdir $(PROJECT_BUILD_PATH)\lib\arm64-v8a 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 @@ -147,10 +147,10 @@ endef # 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\armeabi-v7a\libraylib.so + copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\arm64-v8a\libraylib.so endif ifeq ($(RAYLIB_LIBTYPE),STATIC) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libraylib.a + copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\arm64-v8a\libraylib.a endif # Copy project required resources: strings.xml, icon.png, assets @@ -219,7 +219,7 @@ compile_native_app_glue: # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so compile_project_code: $(OBJS) - $(CC) -o $(PROJECT_BUILD_PATH)/lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) + $(CC) -o $(PROJECT_BUILD_PATH)/lib/arm64-v8a/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 @@ -240,7 +240,7 @@ compile_project_class_dex: # 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-16/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/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) + cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/arm64-v8a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) # Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk sign_project_apk_package: diff --git a/templates/standard_game/Makefile.Android b/templates/standard_game/Makefile.Android index f082ab23..d9503a40 100644 --- a/templates/standard_game/Makefile.Android +++ b/templates/standard_game/Makefile.Android @@ -29,7 +29,7 @@ RAYLIB_PATH ?= ..\.. # NOTE: JAVA_HOME must be set to JDK ANDROID_HOME = C:/android-sdk ANDROID_NDK = C:/android-ndk -ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16 +ANDROID_TOOLCHAIN = C:/android_toolchain_arm64_api21 ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/26.0.2 ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools JAVA_HOME = C:/PROGRA~1/Java/jdk1.8.0_144 @@ -61,21 +61,22 @@ 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\armeabi-v7a +RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\arm64-v8a # 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/armeabi-v7a/libraylib.so + PROJECT_SHARED_LIBS = lib/arm64-v8a/libraylib.so endif # Compiler and archiver # NOTE: GCC is being deprectated in Android NDK r16 -CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-gcc -AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar +CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang +AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar # Compiler flags for arquitecture -CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 +#CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 --> Old 32bit +CFLAGS = -std=c99 -march=arm64-v8a # Compilation functions attributes options CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC # Compiler options for the linker @@ -92,7 +93,7 @@ LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl # 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/armeabi-v7a +LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/arm64-v8a # Define any libraries to link into executable # if you want to link libraries (libname.so or libname.a), use the -lname @@ -127,7 +128,7 @@ create_temp_project_dirs: 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\armeabi-v7a mkdir $(PROJECT_BUILD_PATH)\lib\armeabi-v7a + if not exist $(PROJECT_BUILD_PATH)\lib\arm64-v8a mkdir $(PROJECT_BUILD_PATH)\lib\arm64-v8a 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 @@ -147,10 +148,10 @@ endef # 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\armeabi-v7a\libraylib.so + copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\arm64-v8a\libraylib.so endif ifeq ($(RAYLIB_LIBTYPE),STATIC) - copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\armeabi-v7a\libraylib.a + copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\arm64-v8a\libraylib.a endif # Copy project required resources: strings.xml, icon.png, assets @@ -219,7 +220,7 @@ compile_native_app_glue: # Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so compile_project_code: $(OBJS) - $(CC) -o $(PROJECT_BUILD_PATH)/lib/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) + $(CC) -o $(PROJECT_BUILD_PATH)/lib/arm64-v8a/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 @@ -240,7 +241,7 @@ compile_project_class_dex: # 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-16/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/armeabi-v7a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) + cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/arm64-v8a/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS) # Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk sign_project_apk_package: -- cgit v1.2.3