summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-04-05 13:21:15 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-04-05 13:21:15 +0000
commit2a6efe355bc53dd1ee94775966ede8518ac35afe (patch)
treed0c0b396d8a5d1b07cbeb82ad7204ba8f61876fb
parent3a86dd96a7a4beb9ece511bf6781bab03333f213 (diff)
expedite: remove Evas GL Glew user.
SVN revision: 58361
-rw-r--r--configure.ac5
-rw-r--r--src/bin/Makefile.am7
-rw-r--r--src/bin/engine_gl_glew.c287
-rw-r--r--src/bin/engine_gl_glew.h10
-rw-r--r--src/bin/main.c3
-rw-r--r--src/bin/main.h3
6 files changed, 1 insertions, 314 deletions
diff --git a/configure.ac b/configure.ac
index c4fb2bc..ae3ad89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,10 +67,6 @@ AC_SUBST(ddraw_libs)
67EXPEDITE_CHECK_ENGINE([direct3d], [Direct3D], "yes", [d3d_libs="-ld3d9 -ld3dx9d -lgdi32"]) 67EXPEDITE_CHECK_ENGINE([direct3d], [Direct3D], "yes", [d3d_libs="-ld3d9 -ld3dx9d -lgdi32"])
68AC_SUBST(d3d_libs) 68AC_SUBST(d3d_libs)
69 69
70# OpenGL GLEW
71EXPEDITE_CHECK_ENGINE([opengl-glew], [OpenGL Glew], "yes", [glew_libs="-lglew32 -lgdi32"])
72AC_SUBST(glew_libs)
73
74# Software SDL 70# Software SDL
75EXPEDITE_CHECK_ENGINE([software-sdl], [Software SDL], "yes") 71EXPEDITE_CHECK_ENGINE([software-sdl], [Software SDL], "yes")
76 72
@@ -252,7 +248,6 @@ echo " X Render XCB.................: ${have_xrender_xcb}"
252echo " Software GDI.................: ${have_software_gdi}" 248echo " Software GDI.................: ${have_software_gdi}"
253echo " Software DirectDraw..........: ${have_software_ddraw}" 249echo " Software DirectDraw..........: ${have_software_ddraw}"
254echo " Direct3D.....................: ${have_direct3d}" 250echo " Direct3D.....................: ${have_direct3d}"
255echo " Open GL Glew.................: ${have_opengl_glew}"
256echo " Software SDL.................: ${have_software_sdl}" 251echo " Software SDL.................: ${have_software_sdl}"
257echo " Open GL SDL..................: ${have_opengl_sdl}" 252echo " Open GL SDL..................: ${have_opengl_sdl}"
258echo " FB...........................: ${have_fb}" 253echo " FB...........................: ${have_fb}"
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 78d8914..ea9bbab 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -116,7 +116,7 @@ proxy_text_random.c
116 116
117expedite_CFLAGS = @WIN32_CFLAGS@ 117expedite_CFLAGS = @WIN32_CFLAGS@
118expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ 118expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
119expedite_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 119expedite_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
120expedite_LDFLAGS = @lt_enable_auto_import@ 120expedite_LDFLAGS = @lt_enable_auto_import@
121 121
122if BUILD_SOFTWARE_XLIB 122if BUILD_SOFTWARE_XLIB
@@ -159,11 +159,6 @@ expedite_SOURCES += \
159engine_direct3d.cpp engine_direct3d.h 159engine_direct3d.cpp engine_direct3d.h
160endif 160endif
161 161
162if BUILD_OPENGL_GLEW
163expedite_SOURCES += \
164engine_gl_glew.c engine_gl_glew.h
165endif
166
167if BUILD_SOFTWARE_SDL 162if BUILD_SOFTWARE_SDL
168expedite_SOURCES += \ 163expedite_SOURCES += \
169engine_software_sdl.c engine_software_sdl.h 164engine_software_sdl.c engine_software_sdl.h
diff --git a/src/bin/engine_gl_glew.c b/src/bin/engine_gl_glew.c
deleted file mode 100644
index 43dae3b..0000000
--- a/src/bin/engine_gl_glew.c
+++ /dev/null
@@ -1,287 +0,0 @@
1#include "main.h"
2
3#include <windows.h>
4#include <windowsx.h>
5#include <GL/glew.h>
6#include <Evas_Engine_GL_Glew.h>
7
8
9static HWND window;
10static HINSTANCE instance;
11
12static LRESULT CALLBACK
13MainWndProc(HWND hwnd,
14 UINT uMsg,
15 WPARAM wParam,
16 LPARAM lParam)
17{
18 switch (uMsg)
19 {
20 case WM_CREATE:
21 return 0;
22 case WM_DESTROY:
23 PostQuitMessage(0);
24 return 0;
25 case WM_CLOSE:
26 PostQuitMessage(0);
27 return 0;
28 case WM_WINDOWPOSCHANGED: {
29 PAINTSTRUCT ps;
30 HDC hdc;
31
32 hdc = BeginPaint (window, &ps);
33 evas_damage_rectangle_add(evas,
34 ps.rcPaint.left, ps.rcPaint.top,
35 ps.rcPaint.right - ps.rcPaint.left,
36 ps.rcPaint.bottom - ps.rcPaint.top);
37 EndPaint(window, &ps);
38 return 0;
39 }
40 case WM_SIZING:
41 {
42 PRECT rect = (PRECT)lParam;
43
44 evas_output_viewport_set(evas, 0, 0,
45 rect->right - rect->left,
46 rect->bottom - rect->top);
47 evas_output_size_set(evas,
48 rect->right - rect->left,
49 rect->bottom - rect->top);
50 win_w = rect->right - rect->left;
51 win_h = rect->bottom - rect->top;
52 return 0;
53 }
54 case WM_RBUTTONDOWN:
55 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
56 evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
57 return 0;
58 case WM_LBUTTONDOWN:
59 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
60 evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
61 return 0;
62 case WM_LBUTTONUP:
63 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
64 evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
65 return 0;
66 case WM_RBUTTONUP:
67 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
68 evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
69 return 0;
70 case WM_MOUSEMOVE:
71 if (!evas_pointer_inside_get(evas)) evas_event_feed_mouse_in(evas, 0, NULL);
72 evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL);
73 return 0;
74 case WM_MOUSELEAVE:
75 evas_event_feed_mouse_out(evas, 0, NULL);
76 return 0;
77 /* FIXME : can't find an event when the mouse is entering */
78 case WM_KEYDOWN:
79 case WM_SYSKEYDOWN: {
80 int key;
81
82 key = LOWORD(wParam);
83
84 if ((key == VK_SHIFT) ||
85 (key == VK_LSHIFT) ||
86 (key == VK_RSHIFT))
87 evas_key_modifier_on(evas, "Shift");
88 if ((key == VK_CONTROL) ||
89 (key == VK_LCONTROL) ||
90 (key == VK_RCONTROL))
91 evas_key_modifier_on(evas, "Control");
92 if ((key == VK_MENU) ||
93 (key == VK_LMENU) ||
94 (key == VK_RMENU))
95 evas_key_modifier_on(evas, "Alt");
96 if ((key == VK_LWIN) ||
97 (key == VK_RWIN))
98 evas_key_modifier_on(evas, "Super");
99
100 if (key == VK_CAPITAL)
101 {
102 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
103 evas_key_lock_off(evas, "Caps_Lock");
104 else
105 evas_key_lock_on(evas, "Caps_Lock");
106 }
107 if (key == VK_NUMLOCK)
108 {
109 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
110 evas_key_lock_off(evas, "Num_Lock");
111 else
112 evas_key_lock_on(evas, "Num_Lock");
113 }
114 if (key == VK_SCROLL)
115 {
116 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
117 evas_key_lock_off(evas, "Scroll_Lock");
118 else
119 evas_key_lock_on(evas, "Scroll_Lock");
120 }
121 if (key == VK_ESCAPE)
122 evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
123 if (key == VK_RETURN)
124 evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
125 if (key == VK_LEFT)
126 evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
127 if (key == VK_RIGHT)
128 evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL);
129 if (key == 81)
130 evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
131 if (key == 113)
132 evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
133 return 0;
134 }
135 case WM_KEYUP:
136 case WM_SYSKEYUP: {
137 int key;
138
139 key = LOWORD(wParam);
140
141 if ((key == VK_SHIFT) ||
142 (key == VK_LSHIFT) ||
143 (key == VK_RSHIFT))
144 evas_key_modifier_off(evas, "Shift");
145 if ((key == VK_CONTROL) ||
146 (key == VK_LCONTROL) ||
147 (key == VK_RCONTROL))
148 evas_key_modifier_off(evas, "Control");
149 if ((key == VK_MENU) ||
150 (key == VK_LMENU) ||
151 (key == VK_RMENU))
152 evas_key_modifier_off(evas, "Alt");
153 if ((key == VK_LWIN) ||
154 (key == VK_RWIN))
155 evas_key_modifier_off(evas, "Super");
156 if (key == VK_ESCAPE)
157 evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
158 if (key == VK_RETURN)
159 evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
160 if (key == VK_LEFT)
161 evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
162 if (key == VK_RIGHT)
163 evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
164 if (key == 81)
165 evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
166 if (key == 113)
167 evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
168 return 0;
169 }
170 default:
171 return DefWindowProc(hwnd, uMsg, wParam, lParam);
172 }
173}
174
175Eina_Bool
176engine_gl_glew_args(const char *engine, int width, int height)
177{
178 WNDCLASS wc;
179 RECT rect;
180 HDC dc;
181 Evas_Engine_Info_GL_Glew *einfo;
182 DWORD style;
183 int depth;
184 int i;
185
186 instance = GetModuleHandle(NULL);
187 if (!instance) return EINA_FALSE;
188
189 wc.style = 0;
190 wc.lpfnWndProc = MainWndProc;
191 wc.cbClsExtra = 0;
192 wc.cbWndExtra = 0;
193 wc.hInstance = instance;
194 wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
195 wc.hCursor = LoadCursor (NULL, IDC_ARROW);
196 wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
197 wc.lpszMenuName = NULL;
198 wc.lpszClassName = "Evas_Gl_Glew_Test";
199
200 if(!RegisterClass(&wc))
201 goto free_library;
202
203 rect.left = 0;
204 rect.top = 0;
205 rect.right = width;
206 rect.bottom = height;
207 AdjustWindowRect (&rect, WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE);
208
209 window = CreateWindowEx(0,
210 "Evas_Gl_Glew_Test",
211 "Evas_Gl_Glew_Test",
212 WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_SIZEBOX,
213 CW_USEDEFAULT, CW_USEDEFAULT,
214 rect.right - rect.left, rect.bottom - rect.top,
215 NULL, NULL, instance, NULL);
216 if (!window)
217 goto unregister_class;
218
219 /* make the window non resizable */
220 style = GetWindowLong(window, GWL_STYLE);
221 style &= ~WS_THICKFRAME;
222 if (!SetWindowLong(window, GWL_STYLE, style))
223 goto unregister_class;
224
225 dc = GetDC(NULL);
226 if (!dc)
227 goto destroy_window;
228
229 depth = GetDeviceCaps(dc, BITSPIXEL);
230 ReleaseDC(NULL, dc);
231
232 evas_output_method_set(evas, evas_render_method_lookup("gl_glew"));
233 einfo = (Evas_Engine_Info_GL_Glew *)evas_engine_info_get(evas);
234 if (!einfo)
235 {
236 printf("Evas does not support the GL Glew Engine\n");
237 goto destroy_window;
238 }
239
240 einfo->info.window = window;
241 einfo->info.depth = depth;
242 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
243 {
244 printf("Evas can not setup the informations of the GL Glew Engine\n");
245 goto destroy_window;
246 }
247
248 /* the second parameter is ignored, as it's the first call of ShowWindow */
249 ShowWindow(window, SW_SHOWDEFAULT);
250 UpdateWindow(window);
251
252 return EINA_TRUE;
253
254 destroy_window:
255 DestroyWindow(window);
256 unregister_class:
257 UnregisterClass("Evas_Gl_Glew_Test", instance);
258 free_library:
259 FreeLibrary(instance);
260
261 return EINA_FALSE;
262}
263
264void
265engine_gl_glew_loop(void)
266{
267 MSG msg;
268 int res;
269
270 again:
271 if (!PeekMessage (&msg, window, 0, 0, PM_NOREMOVE))
272 return;
273
274 res = GetMessage (&msg, NULL, 0, 0);
275 TranslateMessage (&msg);
276 DispatchMessage (&msg);
277
278 goto again;
279}
280
281void
282engine_gl_glew_shutdown(void)
283{
284 DestroyWindow(window);
285 UnregisterClass("Evas_Software_Gdi_Test", instance);
286 FreeLibrary(instance);
287}
diff --git a/src/bin/engine_gl_glew.h b/src/bin/engine_gl_glew.h
deleted file mode 100644
index 41439ed..0000000
--- a/src/bin/engine_gl_glew.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ENGINE_GL_GLEW_H__
2#define __ENGINE_GL_GLEW_H__
3
4
5Eina_Bool engine_gl_glew_args(const char *engine, int width, int height);
6void engine_gl_glew_loop(void);
7void engine_gl_glew_shutdown(void);
8
9
10#endif /* __ENGINE_GL_GLEW_H__ */
diff --git a/src/bin/main.c b/src/bin/main.c
index ab564a1..b4c0bf3 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1158,9 +1158,6 @@ static const Expedite_Engine engines[] = {
1158#if HAVE_EVAS_DIRECT3D 1158#if HAVE_EVAS_DIRECT3D
1159 { "direct3d",engine_direct3d_args, engine_direct3d_loop, engine_direct3d_shutdown }, 1159 { "direct3d",engine_direct3d_args, engine_direct3d_loop, engine_direct3d_shutdown },
1160#endif 1160#endif
1161#if HAVE_EVAS_OPENGL_GLEW
1162 { "glew" , engine_gl_glew_args, engine_gl_glew_loop, engine_gl_glew_shutdown },
1163#endif
1164#if HAVE_EVAS_SOFTWARE_SDL 1161#if HAVE_EVAS_SOFTWARE_SDL
1165 { "sdl", engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown }, 1162 { "sdl", engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown },
1166 { "sdl-16",engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown }, 1163 { "sdl-16",engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown },
diff --git a/src/bin/main.h b/src/bin/main.h
index 54c3ce0..4a6f880 100644
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -48,9 +48,6 @@
48#if HAVE_EVAS_DIRECT3D 48#if HAVE_EVAS_DIRECT3D
49#include "engine_direct3d.h" 49#include "engine_direct3d.h"
50#endif 50#endif
51#if HAVE_EVAS_OPENGL_GLEW
52#include "engine_gl_glew.h"
53#endif
54#if HAVE_EVAS_SOFTWARE_SDL 51#if HAVE_EVAS_SOFTWARE_SDL
55#include "engine_software_sdl.h" 52#include "engine_software_sdl.h"
56#endif 53#endif