* ecore_win32_window.c:
fix fullscreen * ecore_evas_win32.c: add fullscreen (d3d and ddraw) and shape (d3d) support minor formatting * configure.ac: enable direct3d support SVN revision: 38248
This commit is contained in:
parent
1fc336c2ee
commit
e66e9cc905
|
@ -596,7 +596,7 @@ ECORE_EVAS_CHECK_MODULE([software-ddraw],
|
||||||
[Software DirectDraw],
|
[Software DirectDraw],
|
||||||
$have_ecore_win32)
|
$have_ecore_win32)
|
||||||
|
|
||||||
want_ecore_evas_direct3d="auto"
|
want_ecore_evas_direct3d="yes"
|
||||||
ECORE_EVAS_CHECK_MODULE([direct3d],
|
ECORE_EVAS_CHECK_MODULE([direct3d],
|
||||||
[$want_ecore_evas_direct3d],
|
[$want_ecore_evas_direct3d],
|
||||||
[Direct3d],
|
[Direct3d],
|
||||||
|
|
|
@ -126,7 +126,7 @@ _ecore_evas_win32_idle_enter(void *data __UNUSED__)
|
||||||
if (_ecore_evas_fps_debug)
|
if (_ecore_evas_fps_debug)
|
||||||
{
|
{
|
||||||
t2 = ecore_time_get();
|
t2 = ecore_time_get();
|
||||||
/* _ecore_evas_fps_debug_rendertime_add(t2 - t1); */
|
/* _ecore_evas_fps_debug_rendertime_add(t2 - t1); */
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -543,8 +543,8 @@ _ecore_evas_win32_event_window_configure(void *data __UNUSED__, int type __UNUSE
|
||||||
ecore_evas_avoid_damage_set(ee, 1);
|
ecore_evas_avoid_damage_set(ee, 1);
|
||||||
}
|
}
|
||||||
/* FIXME: to do... */
|
/* FIXME: to do... */
|
||||||
/* if (ee->shaped) */
|
/* if (ee->shaped) */
|
||||||
/* _ecore_evas_x_resize_shape(ee); */
|
/* _ecore_evas_x_resize_shape(ee); */
|
||||||
if ((ee->expecting_resize.w > 0) &&
|
if ((ee->expecting_resize.w > 0) &&
|
||||||
(ee->expecting_resize.h > 0))
|
(ee->expecting_resize.h > 0))
|
||||||
{
|
{
|
||||||
|
@ -909,17 +909,60 @@ _ecore_evas_win32_borderless_set(Ecore_Evas *ee, int on)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on)
|
_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
{
|
{
|
||||||
if ((ee->prop.fullscreen && on) ||
|
struct _Ecore_Win32_Window *window;
|
||||||
(!ee->prop.fullscreen && !on)) return;
|
|
||||||
|
if ((ee->engine.win32.state.fullscreen && on) ||
|
||||||
|
(!ee->engine.win32.state.fullscreen && !on))
|
||||||
|
return;
|
||||||
|
|
||||||
ee->engine.win32.state.fullscreen = on;
|
ee->engine.win32.state.fullscreen = on;
|
||||||
ecore_win32_window_fullscreen_set(ee->engine.win32.window, ee->prop.borderless);
|
ee->prop.fullscreen = on;
|
||||||
/* FIXME: what to do with that code ?? */
|
|
||||||
/* if (ee->should_be_visible) */
|
window = (struct _Ecore_Win32_Window *)ee->engine.win32.window;
|
||||||
/* ecore_x_netwm_state_request_send(ee->engine.x.win, ee->engine.x.win_root, */
|
|
||||||
/* ECORE_X_WINDOW_STATE_FULLSCREEN, -1, on); */
|
if (on != 0)
|
||||||
/* else */
|
{
|
||||||
/* _ecore_evas_win32_state_update(ee); */
|
ecore_win32_window_shape_set(ee->engine.win32.window, 0, 0, NULL);
|
||||||
|
ecore_win32_window_fullscreen_set(ee->engine.win32.window, on);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ecore_win32_window_fullscreen_set(window, on);
|
||||||
|
ecore_win32_window_shape_set(window,
|
||||||
|
window->shape.width,
|
||||||
|
window->shape.height,
|
||||||
|
window->shape.mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BUILD_ECORE_EVAS_DIRECT3D
|
||||||
|
if (strcmp(ee->driver, "direct3d") == 0)
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Direct3D *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Direct3D *)evas_engine_info_get(ecore_evas_get(ee));
|
||||||
|
if (einfo != NULL)
|
||||||
|
{
|
||||||
|
einfo->info.fullscreen = !!on;
|
||||||
|
einfo->info.layered = window->shape.layered;
|
||||||
|
evas_engine_info_set(ecore_evas_get(ee), (Evas_Engine_Info *)einfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* BUILD_ECORE_EVAS_DIRECT3D */
|
||||||
|
|
||||||
|
#ifdef BUILD_ECORE_EVAS_SOFTWRE_DDRAW
|
||||||
|
if (strcmp(ee->driver, "software_ddraw") == 0)
|
||||||
|
{
|
||||||
|
Evas_Engine_Info_Software_DDraw *einfo;
|
||||||
|
|
||||||
|
einfo = (Evas_Engine_Info_Direct3D *)evas_engine_info_get(ecore_evas_get(ee));
|
||||||
|
if (einfo != NULL)
|
||||||
|
{
|
||||||
|
einfo->info.fullscreen = !!on;
|
||||||
|
/* einfo->info.layered = window->shape.layered; */
|
||||||
|
evas_engine_info_set(ecore_evas_get(ee), (Evas_Engine_Info *)einfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_DDRAW */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1012,7 +1055,7 @@ _ecore_evas_engine_software_ddraw_init(Ecore_Evas *ee)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_DDRAW */
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_DDRAW */
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_DIRECT3D
|
#ifdef BUILD_ECORE_EVAS_DIRECT3D
|
||||||
static int
|
static int
|
||||||
|
@ -1043,7 +1086,7 @@ _ecore_evas_engine_direct3d_init(Ecore_Evas *ee)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* ! BUILD_ECORE_EVAS_DIRECT3D */
|
#endif /* BUILD_ECORE_EVAS_DIRECT3D */
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
|
#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
|
||||||
static int
|
static int
|
||||||
|
@ -1053,13 +1096,13 @@ _ecore_evas_engine_opengl_glew_init(Ecore_Evas *ee)
|
||||||
const char *driver;
|
const char *driver;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
|
||||||
driver = "gl_glew";
|
driver = "opengl_glew";
|
||||||
|
|
||||||
rmethod = evas_render_method_lookup(driver);
|
rmethod = evas_render_method_lookup(driver);
|
||||||
if (!rmethod)
|
if (!rmethod)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ee->driver = "opengl_glew";
|
ee->driver = driver;
|
||||||
evas_output_method_set(ee->evas, rmethod);
|
evas_output_method_set(ee->evas, rmethod);
|
||||||
|
|
||||||
einfo = (Evas_Engine_Info_GL_Glew *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_GL_Glew *)evas_engine_info_get(ee->evas);
|
||||||
|
@ -1073,7 +1116,7 @@ _ecore_evas_engine_opengl_glew_init(Ecore_Evas *ee)
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* ! BUILD_ECORE_EVAS_OPENGL_GLEW */
|
#endif /* BUILD_ECORE_EVAS_OPENGL_GLEW */
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DIRECTDRAW
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_DIRECTDRAW
|
||||||
static int
|
static int
|
||||||
|
@ -1104,8 +1147,10 @@ _ecore_evas_engine_software_16_ddraw_init(Ecore_Evas *ee)
|
||||||
einfo->info.rotation = 0;
|
einfo->info.rotation = 0;
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_16_DIRECTDRAW */
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_DIRECTDRAW */
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
#ifdef BUILD_ECORE_EVAS_WIN32
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
|
@ -1184,7 +1229,7 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#endif /* ! BUILD_ECORE_EVAS_WIN32 */
|
#endif /* BUILD_ECORE_EVAS_WIN32 */
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
|
ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
|
||||||
|
|
|
@ -647,8 +647,6 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *ew;
|
struct _Ecore_Win32_Window *ew;
|
||||||
HWND w;
|
HWND w;
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
|
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
|
||||||
|
@ -657,35 +655,33 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
((!ew->fullscreen) && (!on)))
|
((!ew->fullscreen) && (!on)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ew->fullscreen = on;
|
ew->fullscreen = !!on;
|
||||||
w = ew->window;
|
w = ew->window;
|
||||||
|
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
|
DWORD style;
|
||||||
|
|
||||||
if (!GetWindowRect(w, &ew->rect)) return;
|
if (!GetWindowRect(w, &ew->rect)) return;
|
||||||
ew->style = GetWindowLong(w, GWL_STYLE);
|
if (!(ew->style = GetWindowLong(w, GWL_STYLE))) return;
|
||||||
width = GetSystemMetrics (SM_CXSCREEN);
|
style = ew->style & ~WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX;
|
||||||
height = GetSystemMetrics (SM_CYSCREEN);
|
style |= WS_VISIBLE | WS_POPUP;
|
||||||
if (!SetWindowLong(w, GWL_STYLE,
|
if (!SetWindowLong(w, GWL_STYLE, style)) return;
|
||||||
(ew->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP))
|
if (!SetWindowLong(w, GWL_EXSTYLE, WS_EX_TOPMOST)) return;
|
||||||
return;
|
SetWindowPos(w, HWND_TOPMOST, 0, 0,
|
||||||
if (!SetWindowLong(w, GWL_EXSTYLE, WS_EX_TOPMOST))
|
GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN),
|
||||||
return;
|
SWP_NOCOPYBITS | SWP_SHOWWINDOW);
|
||||||
SetWindowPos(w, HWND_TOPMOST, 0, 0, width, height,
|
|
||||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!SetWindowLong(w, GWL_STYLE, (ew->style & ~WS_POPUP) | WS_OVERLAPPEDWINDOW))
|
if (!SetWindowLong(w, GWL_STYLE, ew->style)) return;
|
||||||
return;
|
if (!SetWindowLong(w, GWL_EXSTYLE, 0)) return;
|
||||||
if (!SetWindowLong(w, GWL_EXSTYLE, 0))
|
|
||||||
return;
|
|
||||||
SetWindowPos(w, HWND_NOTOPMOST,
|
SetWindowPos(w, HWND_NOTOPMOST,
|
||||||
ew->rect.left,
|
ew->rect.left,
|
||||||
ew->rect.top,
|
ew->rect.top,
|
||||||
ew->rect.right - ew->rect.left,
|
ew->rect.right - ew->rect.left,
|
||||||
ew->rect.bottom - ew->rect.top,
|
ew->rect.bottom - ew->rect.top,
|
||||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
SWP_NOCOPYBITS | SWP_SHOWWINDOW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,13 +946,14 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
|
||||||
rect.right = rect.left + minimal_width;
|
rect.right = rect.left + minimal_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
w->window = CreateWindow(ECORE_WIN32_WINDOW_CLASS, "",
|
w->window = CreateWindowEx(0,
|
||||||
style,
|
ECORE_WIN32_WINDOW_CLASS, "",
|
||||||
x, y,
|
style,
|
||||||
rect.right - rect.left,
|
x, y,
|
||||||
rect.bottom - rect.top,
|
rect.right - rect.left,
|
||||||
parent ? ((struct _Ecore_Win32_Window *)parent)->window : NULL,
|
rect.bottom - rect.top,
|
||||||
NULL, _ecore_win32_instance, NULL);
|
parent ? ((struct _Ecore_Win32_Window *)parent)->window : NULL,
|
||||||
|
NULL, _ecore_win32_instance, NULL);
|
||||||
if (!w->window)
|
if (!w->window)
|
||||||
{
|
{
|
||||||
free(w);
|
free(w);
|
||||||
|
|
Loading…
Reference in New Issue