[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] [pingus] 2 new revisions pushed by address@hidden on 2014-0
From: |
pingus |
Subject: |
[Pingus-CVS] [pingus] 2 new revisions pushed by address@hidden on 2014-07-27 02:15 GMT |
Date: |
Sun, 27 Jul 2014 02:15:32 +0000 |
feature/sdl2 moved from bd0879cdaf02 to cdd80b8fadfe
2 new revisions:
Revision: 401b8cfd988f
Author: Ingo Ruhnke <address@hidden>
Date: Sun Jul 27 02:14:18 2014 UTC
Log: Some fixes to fullscreen mode, somewhat incomplete
http://code.google.com/p/pingus/source/detail?r=401b8cfd988f
Revision: cdd80b8fadfe
Author: Ingo Ruhnke <address@hidden>
Date: Sun Jul 27 02:15:09 2014 UTC
Log: Quick fixed for debug message, Component::on_key_pressed() needs
a big...
http://code.google.com/p/pingus/source/detail?r=cdd80b8fadfe
==============================================================================
Revision: 401b8cfd988f
Author: Ingo Ruhnke <address@hidden>
Date: Sun Jul 27 02:14:18 2014 UTC
Log: Some fixes to fullscreen mode, somewhat incomplete
http://code.google.com/p/pingus/source/detail?r=401b8cfd988f
Modified:
/src/engine/display/sdl_framebuffer.cpp
=======================================
--- /src/engine/display/sdl_framebuffer.cpp Sun Jul 27 00:18:02 2014 UTC
+++ /src/engine/display/sdl_framebuffer.cpp Sun Jul 27 02:14:18 2014 UTC
@@ -273,39 +273,56 @@
void
SDLFramebuffer::set_video_mode(const Size& size, bool fullscreen, bool
resizable)
{
- Uint32 flags = 0;
-
- if (fullscreen)
+ if (m_window)
{
- flags |= SDL_WINDOW_FULLSCREEN;
+ if (!fullscreen)
+ {
+ SDL_SetWindowSize(m_window, size.width, size.height);
+ SDL_SetWindowFullscreen(m_window, 0);
+ }
+ else
+ {
+ SDL_SetWindowSize(m_window, size.width, size.height);
+ SDL_SetWindowDisplayMode(m_window, nullptr);
+ SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN);
+ }
}
- else if (resizable)
+ else
{
- flags |= SDL_WINDOW_RESIZABLE;
- }
+ Uint32 flags = 0;
+
+ if (fullscreen)
+ {
+ flags |= SDL_WINDOW_FULLSCREEN;
+ }
+ else if (resizable)
+ {
+ flags |= SDL_WINDOW_RESIZABLE;
+ }
+
+ m_window = SDL_CreateWindow("Pingus " VERSION,
+ SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
+ size.width, size.height,
+ flags);
+ if(m_window == 0)
+ {
+ std::ostringstream msg;
+ msg << "Couldn't set video mode (" << size.width << "x" <<
size.height << "): " << SDL_GetError();
+ throw std::runtime_error(msg.str());
+ }
+ SDL_SetWindowIcon(m_window,
IMG_Load(Pathname("images/icons/pingus.png",
Pathname::DATA_PATH).get_sys_path().c_str()));
- m_window = SDL_CreateWindow("Pingus " VERSION,
- SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
- size.width, size.height,
- flags);
- if(m_window == 0)
- {
- std::ostringstream msg;
- msg << "Couldn't set video mode (" << size.width << "x" << size.height
<< "): " << SDL_GetError();
- throw std::runtime_error(msg.str());
+ m_renderer = SDL_CreateRenderer(m_window, -1,
SDL_RENDERER_ACCELERATED);
+ m_screen = SDL_CreateRGBSurface(0, size.width, size.height, 32,
+ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ 0xFF000000);
+ m_texture = SDL_CreateTexture(m_renderer,
+ SDL_PIXELFORMAT_ARGB8888,
+ SDL_TEXTUREACCESS_STREAMING,
+ size.width, size.height);
}
- SDL_SetWindowIcon(m_window, IMG_Load(Pathname("images/icons/pingus.png",
Pathname::DATA_PATH).get_sys_path().c_str()));
-
- m_renderer = SDL_CreateRenderer(m_window, -1, SDL_RENDERER_ACCELERATED);
- m_screen = SDL_CreateRGBSurface(0, size.width, size.height, 32,
- 0x00FF0000,
- 0x0000FF00,
- 0x000000FF,
- 0xFF000000);
- m_texture = SDL_CreateTexture(m_renderer,
- SDL_PIXELFORMAT_ARGB8888,
- SDL_TEXTUREACCESS_STREAMING,
- size.width, size.height);
}
bool
==============================================================================
Revision: cdd80b8fadfe
Author: Ingo Ruhnke <address@hidden>
Date: Sun Jul 27 02:15:09 2014 UTC
Log: Quick fixed for debug message, Component::on_key_pressed() needs
a bigger rewrite to deal with SDL2 Unicode
http://code.google.com/p/pingus/source/detail?r=cdd80b8fadfe
Modified:
/src/editor/viewport.cpp
=======================================
--- /src/editor/viewport.cpp Sat Jul 26 23:54:13 2014 UTC
+++ /src/editor/viewport.cpp Sun Jul 27 02:15:09 2014 UTC
@@ -478,11 +478,7 @@
break;
default:
-#ifdef OLD_SDL1
- log_debug("Viewport::on_key_pressed: " << ev.keysym.sym
- << " U+" << (boost::format("%04x") % ev.keysym.unicode)
- << " " << UTF8::encode_utf8(ev.keysym.unicode));
-#endif
+ log_debug("Viewport::on_key_pressed: " << ev.keysym.sym);
break;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] [pingus] 2 new revisions pushed by address@hidden on 2014-07-27 02:15 GMT,
pingus <=