Skip to content

Commit d359bc0

Browse files
Updating examples
1 parent be46ca6 commit d359bc0

File tree

2 files changed

+17
-78
lines changed

2 files changed

+17
-78
lines changed

Examples/test.cpp

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,12 @@
66
Source:
77
Type: Git
88
Value: "https://github.com/Neko-Box-Coder/ssLogger.git"
9-
# LibraryType: Static
109
LibraryType: Header
1110
IncludePaths:
1211
- "Include"
1312
14-
# (Optional if LibraryType is Header) Link properties of the dependency
15-
# LinkProperties:
16-
# # Properties for searching the library binary for the profile
17-
# "g++":
18-
# # The library names to be searched for when linking against the script
19-
# SearchLibraryNames: ["ssLogger"]
20-
#
21-
# # (Optional) The library names to be excluded from being searched
22-
# ExcludeLibraryNames: ["ssLogger_SRC"]
23-
#
24-
# # The path (relative to the dependency folder) to be searched for the dependency binaries
25-
# SearchDirectories: ["./build"]
26-
#
27-
# # (Optional) Additional link options for this dependency
28-
# AdditionalLinkOptions:
29-
# All: []
30-
31-
32-
# (Optional) List of setup commands for the supported platforms
3313
Setup:
34-
# Setup commands for the specified platform
3514
All:
36-
# Setup commands for the specified profile.
37-
# All commands are run in the dependency folder
3815
"g++":
3916
- "git submodule update --init --recursive"
4017
- "mkdir build"
@@ -43,13 +20,7 @@
4320
*/
4421

4522

46-
#include "ssLogger/ssLogSwitches.hpp"
47-
48-
#define ssLOG_USE_SOURCE 0
49-
#if !ssLOG_USE_SOURCE
50-
#include "ssLogger/ssLogInit.hpp"
51-
#endif
52-
23+
#include "ssLogger/ssLogInit.hpp"
5324
#include "ssLogger/ssLog.hpp"
5425

5526
#include <iostream>
@@ -75,13 +46,11 @@ int main(int argc, char* argv[])
7546
ssLOG_INFO("Test info: " << CheckCounter);
7647
ssLOG_DEBUG("Test debug: " << CheckCounter);
7748

78-
for(int i = 0; i < 10000; ++i)
49+
for(int i = 0; i < 100; ++i)
7950
{
8051
ssLOG_LINE("Logging test: " << i);
8152
std::this_thread::sleep_for(std::chrono::milliseconds(10));
8253
}
8354

84-
85-
8655
return 0;
87-
}
56+
}

Examples/testSDL.cpp

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,11 @@
11
/* runcpp2
22
3-
# (Optional) The list of dependencies needed by the script
4-
Dependencies:
5-
# Dependency name
6-
- Name: SDL2
7-
8-
# Supported platforms of the dependency
9-
Platforms: [Unix]
10-
11-
# The source of getting the dependency
12-
Source:
13-
Type: Local
14-
Value: "./dummy"
15-
16-
# Library Type (Static, Object, Shared, Header)
17-
LibraryType: Shared
18-
19-
# (Optional if LibraryType is Header) Link properties of the dependency
20-
LinkProperties:
21-
# Properties for searching the library binary for the profile
3+
OverrideLinkFlags:
4+
All:
225
"g++":
23-
# The library names to be searched for when linking against the script
24-
SearchLibraryNames: []
25-
26-
# (Optional) The library names to be excluded from being searched
27-
ExcludeLibraryNames: []
28-
29-
# The path (relative to the dependency folder) to be searched for the dependency binaries
30-
SearchDirectories: []
31-
32-
# (Optional) Additional link options for this dependency
33-
AdditionalLinkOptions:
34-
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
35-
Unix: ["-lSDL2"]
6+
Remove: ""
7+
Append: "-lSDL2"
8+
369
*/
3710

3811

@@ -48,20 +21,19 @@ int main(int arc, char ** argv)
4821

4922
SDL_Window* window = nullptr;
5023

51-
if (SDL_Init( SDL_INIT_VIDEO ) < 0) {
24+
if (SDL_Init( SDL_INIT_VIDEO ) < 0)
5225
std::cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl;
53-
} else {
54-
55-
window = SDL_CreateWindow(
56-
"SDL2 Demo",
57-
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
58-
SCREEN_WIDTH, SCREEN_HEIGHT,
59-
SDL_WINDOW_SHOWN
60-
);
26+
else
27+
{
28+
window = SDL_CreateWindow( "SDL2 Demo",
29+
SDL_WINDOWPOS_CENTERED,
30+
SDL_WINDOWPOS_CENTERED,
31+
SCREEN_WIDTH,
32+
SCREEN_HEIGHT,
33+
SDL_WINDOW_SHOWN);
6134
}
6235

6336
bool quit = false;
64-
6537
SDL_Event e;
6638

6739
while (!quit)
@@ -74,8 +46,6 @@ int main(int arc, char ** argv)
7446
}
7547

7648
SDL_DestroyWindow(window);
77-
7849
SDL_Quit();
79-
8050
return 0;
8151
}

0 commit comments

Comments
 (0)