validated
This commit is contained in:
parent
1422726d2d
commit
2e3953592b
|
@ -6,7 +6,7 @@ project(MyAddin)
|
|||
|
||||
include(GenerateG3A)
|
||||
include(Fxconv)
|
||||
find_package(Gint 2.1 REQUIRED)
|
||||
find_package(Gint 2.4 REQUIRED)
|
||||
|
||||
set(SOURCES
|
||||
src/main.cc
|
||||
|
@ -20,12 +20,12 @@ set(ASSETS_cg
|
|||
fxconv_declare_assets(${ASSETS_cg} WITH_METADATA)
|
||||
|
||||
add_executable(myaddin ${SOURCES} ${ASSETS_${FXSDK_PLATFORM}})
|
||||
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -std=c++11 -c)
|
||||
#target_compile_options(myaddin PRIVATE -Os -mb -m4a-nofpu -mhitachi -std=c++14 -fno-strict-aliasing -ffreestanding -fexceptions)
|
||||
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -std=c++11 -c -fno-rtti -fno-use-cxa-atexit)
|
||||
|
||||
target_link_libraries(myaddin Gint::Gint -lustl -lc)
|
||||
target_link_options(myaddin PRIVATE -Wl,-Map=map)
|
||||
|
||||
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
|
||||
generate_g3a(TARGET myaddin OUTPUT "TestuSTL.g3a"
|
||||
NAME "uSTL Test" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
|
||||
generate_g3a(TARGET myaddin OUTPUT "TestUSTL.g3a"
|
||||
NAME "STL Test" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
example.png:
|
||||
type: bopti-image
|
||||
name: img_example
|
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
|
@ -0,0 +1,3 @@
|
|||
example.png:
|
||||
type: bopti-image
|
||||
name: img_example
|
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
14
src/main.cc
14
src/main.cc
|
@ -1,13 +1,21 @@
|
|||
#include <gint/display.h>
|
||||
#include <gint/keyboard.h>
|
||||
|
||||
#include <gint/defs/types.h>
|
||||
#include <fxlibc/printf.h>
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <array>
|
||||
|
||||
#define std ustl
|
||||
|
||||
int main(void)
|
||||
{
|
||||
__printf_enable_fp();
|
||||
__printf_enable_fixed();
|
||||
|
||||
std::vector<int> v;
|
||||
v.push_back(10);
|
||||
v.push_back(20);
|
||||
|
@ -29,7 +37,6 @@ int main(void)
|
|||
std::string s3("World");
|
||||
std::string s4=s1+s2+s3;
|
||||
|
||||
|
||||
std::array<int, 5> a={-3, -2, -1, 0, 1};
|
||||
|
||||
|
||||
|
@ -43,7 +50,7 @@ int main(void)
|
|||
dtext(200, 25, C_GREEN, "Test std::list");
|
||||
for(int k=0; k<l.size(); k++)
|
||||
dprint( 200, 40+k*10, C_GREEN, "v[%d] = %d",k,l[k]);
|
||||
|
||||
|
||||
dtext(1, 115, C_BLUE, "Test std::string");
|
||||
dprint( 1, 130, C_BLUE, "%s + %s + %s = %s", s1.c_str(), s2.c_str(), s3.c_str(), s4.c_str());
|
||||
|
||||
|
@ -52,12 +59,11 @@ int main(void)
|
|||
int i=0;
|
||||
for(int& k : a)
|
||||
{
|
||||
dprint( 1, 170+i*10, C_BLACK, "a[%d] = %d",i, k);
|
||||
dprint( 1, 170+i*10, C_BLACK, "a[%d] = %d",i, a[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
dupdate();
|
||||
getkey();
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue