Skip to content

Commit a07db79

Browse files
committed
using base dir for path to files
1 parent d961eb3 commit a07db79

File tree

3 files changed

+83
-18
lines changed

3 files changed

+83
-18
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ There are many other applications that make use of libprojectM that can be found
7878
***
7979

8080
## Help
81-
Report issues on [GitHub](https://github.com/projectM-visualizer/projectm/issues/new)
81+
Report issues on [GitHub](https://github.com/projectM-visualizer/projectm/issues/new)
82+
We're on IRC at irc.freenode.net #projectM
8283

8384
## Authors
8485
[Authors](https://github.com/projectM-visualizer/projectm/raw/master/AUTHORS.txt)

src/projectM-sdl/SDLprojectM.xcodeproj/project.pbxproj

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@
138138
};
139139
/* End PBXGroup section */
140140

141+
/* Begin PBXLegacyTarget section */
142+
161070DE1F70942C001905AB /* projectMSDL */ = {
143+
isa = PBXLegacyTarget;
144+
buildArgumentsString = "$(ACTION)";
145+
buildConfigurationList = 161070E11F70942C001905AB /* Build configuration list for PBXLegacyTarget "projectMSDL" */;
146+
buildPhases = (
147+
);
148+
buildToolPath = /usr/bin/make;
149+
dependencies = (
150+
);
151+
name = projectMSDL;
152+
passBuildSettingsInEnvironment = 1;
153+
productName = projectMSDL;
154+
};
155+
/* End PBXLegacyTarget section */
156+
141157
/* Begin PBXNativeTarget section */
142158
C34521431BF02293001707D2 /* SDLprojectM */ = {
143159
isa = PBXNativeTarget;
@@ -166,6 +182,10 @@
166182
LastUpgradeCheck = 0830;
167183
ORGANIZATIONNAME = int80;
168184
TargetAttributes = {
185+
161070DE1F70942C001905AB = {
186+
CreatedOnToolsVersion = 8.3.3;
187+
ProvisioningStyle = Automatic;
188+
};
169189
C34521431BF02293001707D2 = {
170190
CreatedOnToolsVersion = 7.1;
171191
};
@@ -184,6 +204,7 @@
184204
projectRoot = "";
185205
targets = (
186206
C34521431BF02293001707D2 /* SDLprojectM */,
207+
161070DE1F70942C001905AB /* projectMSDL */,
187208
);
188209
};
189210
/* End PBXProject section */
@@ -201,6 +222,37 @@
201222
/* End PBXSourcesBuildPhase section */
202223

203224
/* Begin XCBuildConfiguration section */
225+
161070DF1F70942C001905AB /* Debug */ = {
226+
isa = XCBuildConfiguration;
227+
buildSettings = {
228+
ALWAYS_SEARCH_USER_PATHS = NO;
229+
CLANG_ANALYZER_NONNULL = YES;
230+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
231+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
232+
DEBUGGING_SYMBOLS = YES;
233+
DEBUG_INFORMATION_FORMAT = dwarf;
234+
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
235+
GCC_OPTIMIZATION_LEVEL = 0;
236+
OTHER_CFLAGS = "";
237+
OTHER_LDFLAGS = "";
238+
PRODUCT_NAME = "$(TARGET_NAME)";
239+
};
240+
name = Debug;
241+
};
242+
161070E01F70942C001905AB /* Release */ = {
243+
isa = XCBuildConfiguration;
244+
buildSettings = {
245+
ALWAYS_SEARCH_USER_PATHS = NO;
246+
CLANG_ANALYZER_NONNULL = YES;
247+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
248+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
249+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
250+
OTHER_CFLAGS = "";
251+
OTHER_LDFLAGS = "";
252+
PRODUCT_NAME = "$(TARGET_NAME)";
253+
};
254+
name = Release;
255+
};
204256
C34521491BF02294001707D2 /* Debug */ = {
205257
isa = XCBuildConfiguration;
206258
buildSettings = {
@@ -341,6 +393,14 @@
341393
/* End XCBuildConfiguration section */
342394

343395
/* Begin XCConfigurationList section */
396+
161070E11F70942C001905AB /* Build configuration list for PBXLegacyTarget "projectMSDL" */ = {
397+
isa = XCConfigurationList;
398+
buildConfigurations = (
399+
161070DF1F70942C001905AB /* Debug */,
400+
161070E01F70942C001905AB /* Release */,
401+
);
402+
defaultConfigurationIsVisible = 0;
403+
};
344404
C345213F1BF02293001707D2 /* Build configuration list for PBXProject "SDLprojectM" */ = {
345405
isa = XCConfigurationList;
346406
buildConfigurations = (

src/projectM-sdl/projectM_SDL_main.cpp

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,24 @@
1212
#include "pmSDL.hpp"
1313

1414
int main( int argc, char *argv[] ) {
15-
projectM::Settings settings;
15+
const int width = 1024, height = 768; // FIXME: use screen res?
16+
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
17+
18+
// get path to our app
19+
std::string base_path = SDL_GetBasePath();
20+
21+
SDL_Window *win = SDL_CreateWindow("projectM", 0, 0, width, height, SDL_WINDOW_RESIZABLE);
22+
SDL_Renderer *rend = SDL_CreateRenderer(win, 0, SDL_RENDERER_ACCELERATED);
23+
if (! rend) {
24+
fprintf(stderr, "Failed to create renderer: %s\n", SDL_GetError());
25+
SDL_Quit();
26+
}
27+
SDL_SetWindowTitle(win, "projectM Visualizer");
1628

17-
settings.windowWidth = 1024;
18-
settings.windowHeight = 768;
29+
// init projectM
30+
projectM::Settings settings;
31+
settings.windowWidth = width;
32+
settings.windowHeight = height;
1933
settings.meshX = 1;
2034
settings.meshY = 1;
2135
settings.fps = FPS;
@@ -27,21 +41,11 @@ int main( int argc, char *argv[] ) {
2741
settings.easterEgg = 0; // ???
2842
settings.shuffleEnabled = 1;
2943
settings.softCutRatingsEnabled = 1; // ???
30-
settings.presetURL = "presets/presets_tryptonaut";
31-
settings.menuFontURL = "fonts/Vera.ttf";
32-
settings.titleFontURL = "fonts/Vera.ttf";
33-
34-
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
35-
auto win = SDL_CreateWindow("projectM", 0, 0, settings.windowWidth, settings.windowHeight, SDL_WINDOW_RESIZABLE);
36-
auto rend = SDL_CreateRenderer(win, 0, SDL_RENDERER_ACCELERATED);
37-
if (! rend) {
38-
fprintf(stderr, "Failed to create renderer: %s\n", SDL_GetError());
39-
SDL_Quit();
40-
}
41-
SDL_SetWindowTitle(win, "projectM Visualizer");
44+
settings.presetURL = base_path + "presets/presets_tryptonaut";
45+
settings.menuFontURL = base_path + "fonts/Vera.ttf";
46+
settings.titleFontURL = base_path + "fonts/Vera.ttf";
4247

43-
auto *app = new projectMSDL(settings, 0);
44-
48+
projectMSDL *app = new projectMSDL(settings, 0);
4549
app->init(win, rend);
4650

4751
// get an audio input device

0 commit comments

Comments
 (0)