expedite: remove Evas GL Glew user.

SVN revision: 58361
This commit is contained in:
Cedric BAIL 2011-04-05 13:21:15 +00:00
parent 3a86dd96a7
commit 2a6efe355b
6 changed files with 1 additions and 314 deletions

View File

@ -67,10 +67,6 @@ AC_SUBST(ddraw_libs)
EXPEDITE_CHECK_ENGINE([direct3d], [Direct3D], "yes", [d3d_libs="-ld3d9 -ld3dx9d -lgdi32"])
AC_SUBST(d3d_libs)
# OpenGL GLEW
EXPEDITE_CHECK_ENGINE([opengl-glew], [OpenGL Glew], "yes", [glew_libs="-lglew32 -lgdi32"])
AC_SUBST(glew_libs)
# Software SDL
EXPEDITE_CHECK_ENGINE([software-sdl], [Software SDL], "yes")
@ -252,7 +248,6 @@ echo " X Render XCB.................: ${have_xrender_xcb}"
echo " Software GDI.................: ${have_software_gdi}"
echo " Software DirectDraw..........: ${have_software_ddraw}"
echo " Direct3D.....................: ${have_direct3d}"
echo " Open GL Glew.................: ${have_opengl_glew}"
echo " Software SDL.................: ${have_software_sdl}"
echo " Open GL SDL..................: ${have_opengl_sdl}"
echo " FB...........................: ${have_fb}"

View File

@ -116,7 +116,7 @@ proxy_text_random.c
expedite_CFLAGS = @WIN32_CFLAGS@
expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @wince_16_libs@ @glew_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ -lm
expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @wince_16_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ -lm
expedite_LDFLAGS = @lt_enable_auto_import@
if BUILD_SOFTWARE_XLIB
@ -159,11 +159,6 @@ expedite_SOURCES += \
engine_direct3d.cpp engine_direct3d.h
endif
if BUILD_OPENGL_GLEW
expedite_SOURCES += \
engine_gl_glew.c engine_gl_glew.h
endif
if BUILD_SOFTWARE_SDL
expedite_SOURCES += \
engine_software_sdl.c engine_software_sdl.h

View File

@ -1,287 +0,0 @@
#include "main.h"
#include <windows.h>
#include <windowsx.h>
#include <GL/glew.h>
#include <Evas_Engine_GL_Glew.h>
static HWND window;
static HINSTANCE instance;
static LRESULT CALLBACK
MainWndProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch (uMsg)
{
case WM_CREATE:
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_CLOSE:
PostQuitMessage(0);
return 0;
case WM_WINDOWPOSCHANGED: {
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint (window, &ps);
evas_damage_rectangle_add(evas,
ps.rcPaint.left, ps.rcPaint.top,
ps.rcPaint.right - ps.rcPaint.left,
ps.rcPaint.bottom - ps.rcPaint.top);
EndPaint(window, &ps);
return 0;
}
case WM_SIZING:
{
PRECT rect = (PRECT)lParam;
evas_output_viewport_set(evas, 0, 0,
rect->right - rect->left,
rect->bottom - rect->top);
evas_output_size_set(evas,
rect->right - rect->left,
rect->bottom - rect->top);
win_w = rect->right - rect->left;
win_h = rect->bottom - rect->top;
return 0;
}
case WM_RBUTTONDOWN:
evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
return 0;
case WM_LBUTTONDOWN:
evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
return 0;
case WM_LBUTTONUP:
evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
return 0;
case WM_RBUTTONUP:
evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
return 0;
case WM_MOUSEMOVE:
if (!evas_pointer_inside_get(evas)) evas_event_feed_mouse_in(evas, 0, NULL);
evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
return 0;
case WM_MOUSELEAVE:
evas_event_feed_mouse_out(evas, 0, NULL);
return 0;
/* FIXME : can't find an event when the mouse is entering */
case WM_KEYDOWN:
case WM_SYSKEYDOWN: {
int key;
key = LOWORD(wParam);
if ((key == VK_SHIFT) ||
(key == VK_LSHIFT) ||
(key == VK_RSHIFT))
evas_key_modifier_on(evas, "Shift");
if ((key == VK_CONTROL) ||
(key == VK_LCONTROL) ||
(key == VK_RCONTROL))
evas_key_modifier_on(evas, "Control");
if ((key == VK_MENU) ||
(key == VK_LMENU) ||
(key == VK_RMENU))
evas_key_modifier_on(evas, "Alt");
if ((key == VK_LWIN) ||
(key == VK_RWIN))
evas_key_modifier_on(evas, "Super");
if (key == VK_CAPITAL)
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_key_lock_off(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
}
if (key == VK_NUMLOCK)
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
evas_key_lock_off(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
}
if (key == VK_SCROLL)
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
evas_key_lock_off(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
}
if (key == VK_ESCAPE)
evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
if (key == VK_RETURN)
evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
if (key == VK_LEFT)
evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
if (key == VK_RIGHT)
evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL);
if (key == 81)
evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
if (key == 113)
evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
return 0;
}
case WM_KEYUP:
case WM_SYSKEYUP: {
int key;
key = LOWORD(wParam);
if ((key == VK_SHIFT) ||
(key == VK_LSHIFT) ||
(key == VK_RSHIFT))
evas_key_modifier_off(evas, "Shift");
if ((key == VK_CONTROL) ||
(key == VK_LCONTROL) ||
(key == VK_RCONTROL))
evas_key_modifier_off(evas, "Control");
if ((key == VK_MENU) ||
(key == VK_LMENU) ||
(key == VK_RMENU))
evas_key_modifier_off(evas, "Alt");
if ((key == VK_LWIN) ||
(key == VK_RWIN))
evas_key_modifier_off(evas, "Super");
if (key == VK_ESCAPE)
evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
if (key == VK_RETURN)
evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
if (key == VK_LEFT)
evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
if (key == VK_RIGHT)
evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
if (key == 81)
evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
if (key == 113)
evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
return 0;
}
default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
}
Eina_Bool
engine_gl_glew_args(const char *engine, int width, int height)
{
WNDCLASS wc;
RECT rect;
HDC dc;
Evas_Engine_Info_GL_Glew *einfo;
DWORD style;
int depth;
int i;
instance = GetModuleHandle(NULL);
if (!instance) return EINA_FALSE;
wc.style = 0;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = instance;
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "Evas_Gl_Glew_Test";
if(!RegisterClass(&wc))
goto free_library;
rect.left = 0;
rect.top = 0;
rect.right = width;
rect.bottom = height;
AdjustWindowRect (&rect, WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE);
window = CreateWindowEx(0,
"Evas_Gl_Glew_Test",
"Evas_Gl_Glew_Test",
WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_SIZEBOX,
CW_USEDEFAULT, CW_USEDEFAULT,
rect.right - rect.left, rect.bottom - rect.top,
NULL, NULL, instance, NULL);
if (!window)
goto unregister_class;
/* make the window non resizable */
style = GetWindowLong(window, GWL_STYLE);
style &= ~WS_THICKFRAME;
if (!SetWindowLong(window, GWL_STYLE, style))
goto unregister_class;
dc = GetDC(NULL);
if (!dc)
goto destroy_window;
depth = GetDeviceCaps(dc, BITSPIXEL);
ReleaseDC(NULL, dc);
evas_output_method_set(evas, evas_render_method_lookup("gl_glew"));
einfo = (Evas_Engine_Info_GL_Glew *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the GL Glew Engine\n");
goto destroy_window;
}
einfo->info.window = window;
einfo->info.depth = depth;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the GL Glew Engine\n");
goto destroy_window;
}
/* the second parameter is ignored, as it's the first call of ShowWindow */
ShowWindow(window, SW_SHOWDEFAULT);
UpdateWindow(window);
return EINA_TRUE;
destroy_window:
DestroyWindow(window);
unregister_class:
UnregisterClass("Evas_Gl_Glew_Test", instance);
free_library:
FreeLibrary(instance);
return EINA_FALSE;
}
void
engine_gl_glew_loop(void)
{
MSG msg;
int res;
again:
if (!PeekMessage (&msg, window, 0, 0, PM_NOREMOVE))
return;
res = GetMessage (&msg, NULL, 0, 0);
TranslateMessage (&msg);
DispatchMessage (&msg);
goto again;
}
void
engine_gl_glew_shutdown(void)
{
DestroyWindow(window);
UnregisterClass("Evas_Software_Gdi_Test", instance);
FreeLibrary(instance);
}

View File

@ -1,10 +0,0 @@
#ifndef __ENGINE_GL_GLEW_H__
#define __ENGINE_GL_GLEW_H__
Eina_Bool engine_gl_glew_args(const char *engine, int width, int height);
void engine_gl_glew_loop(void);
void engine_gl_glew_shutdown(void);
#endif /* __ENGINE_GL_GLEW_H__ */

View File

@ -1158,9 +1158,6 @@ static const Expedite_Engine engines[] = {
#if HAVE_EVAS_DIRECT3D
{ "direct3d",engine_direct3d_args, engine_direct3d_loop, engine_direct3d_shutdown },
#endif
#if HAVE_EVAS_OPENGL_GLEW
{ "glew" , engine_gl_glew_args, engine_gl_glew_loop, engine_gl_glew_shutdown },
#endif
#if HAVE_EVAS_SOFTWARE_SDL
{ "sdl", engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown },
{ "sdl-16",engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown },

View File

@ -48,9 +48,6 @@
#if HAVE_EVAS_DIRECT3D
#include "engine_direct3d.h"
#endif
#if HAVE_EVAS_OPENGL_GLEW
#include "engine_gl_glew.h"
#endif
#if HAVE_EVAS_SOFTWARE_SDL
#include "engine_software_sdl.h"
#endif