Updated configure
This commit is contained in:
parent
b7c62a83d9
commit
d8de838dfe
4 changed files with 39 additions and 57 deletions
|
@ -154,13 +154,6 @@
|
||||||
remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
|
remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
|
||||||
remoteInfo = libSDL;
|
remoteInfo = libSDL;
|
||||||
};
|
};
|
||||||
04AB757011E563D200BE9753 /* PBXContainerItemProxy */ = {
|
|
||||||
isa = PBXContainerItemProxy;
|
|
||||||
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
|
|
||||||
proxyType = 2;
|
|
||||||
remoteGlobalIDString = 006E982211955059001DE610;
|
|
||||||
remoteInfo = testsdl;
|
|
||||||
};
|
|
||||||
FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
|
FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
|
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
|
||||||
|
@ -374,7 +367,6 @@
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
FD1B489E0E313154007AB34E /* libSDL2.a */,
|
FD1B489E0E313154007AB34E /* libSDL2.a */,
|
||||||
04AB757111E563D200BE9753 /* testsdl.app */,
|
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -597,13 +589,6 @@
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
|
|
||||||
/* Begin PBXReferenceProxy section */
|
/* Begin PBXReferenceProxy section */
|
||||||
04AB757111E563D200BE9753 /* testsdl.app */ = {
|
|
||||||
isa = PBXReferenceProxy;
|
|
||||||
fileType = wrapper.application;
|
|
||||||
path = testsdl.app;
|
|
||||||
remoteRef = 04AB757011E563D200BE9753 /* PBXContainerItemProxy */;
|
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
|
||||||
};
|
|
||||||
FD1B489E0E313154007AB34E /* libSDL2.a */ = {
|
FD1B489E0E313154007AB34E /* libSDL2.a */ = {
|
||||||
isa = PBXReferenceProxy;
|
isa = PBXReferenceProxy;
|
||||||
fileType = archive.ar;
|
fileType = archive.ar;
|
||||||
|
|
|
@ -24,5 +24,7 @@
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>NSMainNibFile</key>
|
<key>NSMainNibFile</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -37,50 +37,45 @@ render(SDL_Renderer *renderer)
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
if (SDL_Init(SDL_INIT_VIDEO/* | SDL_INIT_AUDIO*/) < 0)
|
||||||
SDL_Window *window;
|
{
|
||||||
SDL_Renderer *renderer;
|
printf("Unable to initialize SDL");
|
||||||
int done;
|
|
||||||
SDL_Event event;
|
|
||||||
|
|
||||||
/* initialize SDL */
|
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
|
||||||
fatalError("Could not initialize SDL");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* seed random number generator */
|
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
||||||
srand(time(NULL));
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
|
||||||
|
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||||
|
|
||||||
/* create window and renderer */
|
int landscape = 1;
|
||||||
window =
|
int modes = SDL_GetNumDisplayModes(0);
|
||||||
SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
int sx = 0, sy = 0;
|
||||||
SDL_WINDOW_SHOWN);
|
for (int i = 0; i < modes; i++)
|
||||||
if (window == 0) {
|
{
|
||||||
fatalError("Could not initialize Window");
|
SDL_DisplayMode mode;
|
||||||
|
SDL_GetDisplayMode(0, i, &mode);
|
||||||
|
if (landscape ? mode.w > sx : mode.h > sy)
|
||||||
|
{
|
||||||
|
sx = mode.w;
|
||||||
|
sy = mode.h;
|
||||||
}
|
}
|
||||||
renderer = SDL_CreateRenderer(window, -1, 0);
|
|
||||||
if (!renderer) {
|
|
||||||
fatalError("Could not create renderer");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill screen with black */
|
printf("picked: %d %d\n", sx, sy);
|
||||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
|
||||||
SDL_RenderClear(renderer);
|
|
||||||
|
|
||||||
/* Enter render loop, waiting for user to quit */
|
SDL_Window *_sdl_window = NULL;
|
||||||
done = 0;
|
SDL_GLContext _sdl_context = NULL;
|
||||||
while (!done) {
|
|
||||||
while (SDL_PollEvent(&event)) {
|
|
||||||
if (event.type == SDL_QUIT) {
|
|
||||||
done = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
render(renderer);
|
|
||||||
SDL_Delay(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* shutdown SDL */
|
_sdl_window = SDL_CreateWindow("fred",
|
||||||
SDL_Quit();
|
0, 0,
|
||||||
|
sx, sy,
|
||||||
|
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS);
|
||||||
|
|
||||||
|
SDL_SetHint("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight");
|
||||||
|
|
||||||
|
int ax = 0, ay = 0;
|
||||||
|
SDL_GetWindowSize(_sdl_window, &ax, &ay);
|
||||||
|
|
||||||
|
printf("given: %d %d\n", ax, ay);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
2
configure
vendored
2
configure
vendored
|
@ -15846,7 +15846,7 @@ find_lib()
|
||||||
host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
|
host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
|
||||||
fi
|
fi
|
||||||
for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
|
for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
|
||||||
lib=`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`
|
lib=`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`
|
||||||
if test x$lib != x; then
|
if test x$lib != x; then
|
||||||
echo $lib
|
echo $lib
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue