Jackalope / jrf (public) (License: GPLv3 or later version) (since 2019-11-21) (hash sha1)
Libriary for reading and writing resource files: vertices, indices, meshes, images, models and scene data.
Supports reading from filesystem as well as from zip files.
It uses unique binary container format for those resources.
It is used in tool for converting popular formats like wavefront .obj file, TARGA image to this container and also used in resource loader as part of graphics framework.

It requires jlib libriary (see my user repositories) and libzip.
It is possible to remove libzip dependency.
List of commits:
Subject Hash Author Date (UTC)
CMake installation target 57ba69a5bc17124a96b401c20e68f1602345c4f7 Jackalope 2020-05-24 13:22:15
Moved read,write functions to read.h,write.h, merged vertices,indices and mesh files to mesh.h 365bcb01b01e95448e223de82e9f9e96b51fa789 Jackalope 2020-05-24 13:21:23
Update for new JLIB target a1152ffa6340863fbbd216a4d38806e2d31d3dd5 Jackalope 2020-05-23 23:27:05
added CMake project PARENT_SCOPE variables JRF_* 5ac8009d6709f681fbe0d59dba8cdd646a3cdc47 Jackalope 2020-05-20 19:06:51
added version number definitions, changed magic number (because incompatible) 46ccce5359274d660b327c667903b9534dc3bfe0 Jackalope 2020-05-19 17:39:57
Changed image formats, BGR->RGB convertion while reading from TARGA 297dd913b6084e890e5bd3d53f88d06a8f14657a Jackalope 2020-05-19 17:17:53
Changed cmake library interface 9c704c515769a03e5b1f82dcb1fd947884f1bd1e Jackalope 2020-05-12 06:58:47
added copyright notice to convert.cpp and convert.h a778f4f4a4783656fefac85440e135ddcda3788c Jackalope 2020-05-12 05:18:35
fixes after prev commit changes fc46b4bacf1c69f6eae0c679b26e3b88d1796217 Jackalope 2020-05-11 08:14:50
convert image from tga and add alpha channel functions 4541972149b6b19afda05c608d4abe88a72098bb Jackalope 2020-05-11 07:49:43
more image formats 77bf7ec016cfb604e4a8e06734a4eb71bb299df0 Jackalope 2020-05-11 07:48:46
added license d7c63a0b6199c7f5c1680559953eef1699ec9a48 Jackalope 2020-05-10 01:01:00
refactoring 66f541c32f51d6ed6f90fba1f3b58561726e8659 Jackalope 2020-05-10 00:55:34
extra vertices check c3bd2141d2eaeb96beb5c8ad29e3333c015db4c8 jp.larry 2019-12-26 14:38:29
removed dead code f4ddde689122f1b96fda5292e69f612bf2ca327d jp.larry 2019-12-26 14:38:06
removed forgotten vertex data_size writing 25244188b395b6cca35502f4156d3e78cc1e74ec jp.larry 2019-12-26 13:19:31
better read errors d6d7bc5df695d694ea0dee225905212ef1dfe41b jp.larry 2019-12-26 13:18:55
changed vertices file structure to prevent undefined behaviour 603e283ccf234f87f6e8c38a669280be36a5aafb jp.larry 2019-12-26 12:35:05
vertex attributes is separated, not inteleaved now d3e7b79c74e9fae7b8b788d1a55db2e664feb107 jp.larry 2019-12-26 01:19:17
compiled on windows with mingw 51eacaf02dd542415cea1edd615d88234fb5b344 Jackalope 2019-12-15 07:05:58
Commit 57ba69a5bc17124a96b401c20e68f1602345c4f7 - CMake installation target
Author: Jackalope
Author date (UTC): 2020-05-24 13:22
Committer name: Jackalope
Committer date (UTC): 2020-05-24 13:22
Parent(s): 365bcb01b01e95448e223de82e9f9e96b51fa789
Signing key:
Tree: 8532a81e9e3dd9ba59f54a4797b79b35151708ea
File Lines added Lines deleted
CMakeLists.txt 81 20
version.cmake.in 13 0
File CMakeLists.txt changed (mode: 100644) (index 74d48f7..45b58e2)
1 1 cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
2 2 project(JRF project(JRF
3 3 DESCRIPTION "Containers and various formats utility" DESCRIPTION "Containers and various formats utility"
4 VERSION 0.1.1
4 VERSION 0.2.0
5 5 LANGUAGES CXX LANGUAGES CXX
6 6 ) )
7 set(JRF_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} PARENT_SCOPE)
8 set(JRF_VERSION_MINOR ${PROJECT_VERSION_MINOR} PARENT_SCOPE)
9 set(JRF_VERSION_PATCH ${PROJECT_VERSION_PATCH} PARENT_SCOPE)
10 set(JRF_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
11 set(JRF_NAME ${PROJECT_NAME} PARENT_SCOPE)
12 set(JRF_DESCRIPTION ${PROJECT_DESCRIPTION} PARENT_SCOPE)
13 set(JRF_VERSION_NUMBER 1)
14 add_library(JRF STATIC src/result.cpp src/convert.cpp)
15 target_include_directories(JRF PUBLIC
16 ${CMAKE_CURRENT_SOURCE_DIR}/include
17 ${LIBZIP_INCLUDE_DIR}
18 )
19 target_link_libraries(JRF jlib ${LIBZIP_INCLUDE_LIBS})
20 target_compile_features(JRF PUBLIC cxx_std_17)
21 string(LENGTH "${CMAKE_SOURCE_DIR}/" SOURCE_PATH_SIZE)
22 target_compile_definitions(JRF
7 find_package(jlib 0.2.0 REQUIRED)
8 find_library(ZIP_LIB NAMES libzip libzip.so)
9
10 set(JRF_CONTAINER_VERSION_NUMBER 1)
11
12 add_library(jrf STATIC
13 src/result.cpp
14 src/convert.cpp
15 )
16 set(INCLUDE_FILES
17 result.h
18 mesh.h
19 image.h
20 model.h
21 scene.h
22 jrf.h
23 convert.h
24 read.h
25 write.h
26 zip.h
27 )
28 list(TRANSFORM INCLUDE_FILES PREPEND jrf/)
29
30 set(EXPORT_NAME jrf-${PROJECT_VERSION})
31
32 target_include_directories(jrf PUBLIC
33 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
34 $<INSTALL_INTERFACE:include/${EXPORT_NAME}>
35 )
36 target_link_libraries(jrf PUBLIC jlib ${ZIP_LIB})
37 target_compile_features(jrf PUBLIC cxx_std_17)
38
39 target_compile_definitions(jrf
23 40 PUBLIC PUBLIC
24 41 JRF_NAME="${PROJECT_NAME}" JRF_NAME="${PROJECT_NAME}"
25 42 JRF_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} JRF_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
26 43 JRF_VERSION_MINOR=${PROJECT_VERSION_MINOR} JRF_VERSION_MINOR=${PROJECT_VERSION_MINOR}
27 44 JRF_VERSION_PATCH=${PROJECT_VERSION_PATCH} JRF_VERSION_PATCH=${PROJECT_VERSION_PATCH}
28 45 JRF_VERSION=${PROJECT_VERSION} JRF_VERSION=${PROJECT_VERSION}
29 JRF_VERSION_NUMBER=${JRF_VERSION_NUMBER}
30 PRIVATE
31 SOURCE_PATH_SIZE=${SOURCE_PATH_SIZE}
46 JRF_CONTAINER_VERSION_NUMBER=${JRF_CONTAINER_VERSION_NUMBER}
47 )
48
49 option(JRF_NATIVE "Enable non-portable compiling optimizations" ON)
50 if (JRF_NATIVE)
51 target_compile_options(jrf PRIVATE -march=native)
52 message(STATUS "Compiling for native arch!")
53 endif()
54
55 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
56 OR
57 CMAKE_CXX_COMPILER_ID STREQUAL "GCC")
58 target_compile_options(jrf PRIVATE -fno-exceptions -fno-rtti -ffast-math)
59 endif()
60
61 option(JRF_LTO "Enable LTO" ON)
62 if (JRF_LTO AND CMAKE_BUILD_TYPE STREQUAL Release)
63 set_property(TARGET jrf APPEND_STRING PROPERTY LINK_FLAGS -flto)
64 target_compile_options(jrf PRIVATE -flto)
65 message(STATUS "LTO is enabled")
66 endif()
67
68 set(INSTALL_DIR include/${EXPORT_NAME})
69 foreach(FILE ${INCLUDE_FILES})
70 get_filename_component(DIR_PATH ${FILE} DIRECTORY)
71 install(FILES include/${FILE} DESTINATION ${INSTALL_DIR}/${DIR_PATH} )
72 endforeach()
73
74 configure_file(version.cmake.in
75 ${CMAKE_CURRENT_BINARY_DIR}/version.cmake
76 @ONLY
77 )
78 set_target_properties(jrf PROPERTIES
79 SUFFIX .so.${PROJECT_VERSION}
80 DEBUG_POSTFIX d
81 )
82 install(TARGETS jrf
83 DESTINATION lib
84 EXPORT jrf-config
85 PUBLIC_HEADER DESTINATION include/${EXPORT_NAME}
86 )
87 install(EXPORT jrf-config
88 DESTINATION cmake/${EXPORT_NAME}
89 )
90 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.cmake
91 DESTINATION cmake/${EXPORT_NAME}
92 RENAME jrf-config-version.cmake
32 93 ) )
File version.cmake.in added (mode: 100644) (index 0000000..7397b66)
1 set(PACKAGE_VERSION "@PROJECT_VERSION@")
2
3 if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@PROJECT_VERSION_MAJOR@")
4 if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@PROJECT_VERSION_MINOR@")
5 set(PACKAGE_VERSION_EXACT TRUE)
6 elseif("${PACKAGE_FIND_VERSION_MINOR}" LESS "@PROJECT_VERSION_MINOR@")
7 set(PACKAGE_VERSION_COMPATIBLE TRUE)
8 else()
9 set(PACKAGE_VERSION_UNSUITABLE TRUE)
10 endif()
11 else()
12 set(PACKAGE_VERSION_UNSUITABLE TRUE)
13 endif()
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Jackalope/jrf

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jrf

Clone this repository using git:
git clone git://git.rocketgit.com/user/Jackalope/jrf

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main