Browse Source

Button event hinzugefgt

seba 12 years ago
parent
commit
ce1f282bc0
3 changed files with 10 additions and 3 deletions
  1. 3
    2
      Makefile
  2. 7
    0
      glgui/button.cpp
  3. 0
    1
      glgui/window.h

+ 3
- 2
Makefile View File

@@ -1,13 +1,14 @@
1 1
 COMPILER = g++
2 2
 OBJECTS = emath.o emath_opengl.o glcolor.o gldrawhelper.o glfontengine.o glrect.o gltexture.o matrix.o quaternion.o rotationsmatrix.o glgui/glgui.a
3 3
 VERSION = 0.0.1
4
+LIBNAME = segl
4 5
 
5 6
 
6 7
 sgllib: $(OBJECTS)
7 8
 
8 9
 sglar: $(OBJECTS)
9
-	rm -f sgllib.a
10
-	ar rfc sgllib.a $(OBJECTS)
10
+	rm -f lib$(LIBNAME).a
11
+	ar rfc lib$(LIBNAME).a $(OBJECTS)
11 12
 	
12 13
 %.o: %.cpp %.h
13 14
 	$(COMPILER) -c `sdl-config --cflags` $<

+ 7
- 0
glgui/button.cpp View File

@@ -16,3 +16,10 @@ GLGuiButton::GLGuiButton(int _eventid, std::string str, int _x, int _y, bool _ce
16 16
 void GLGuiButton::onMouseOver(int m_x, int m_y) {
17 17
 	// Längste stelle finden, dann collision
18 18
 }
19
+
20
+void GLGuiButton::onMouseClick(int m_x, int m_y, int m_button) {
21
+	SDL_Event e;
22
+	e.type = GLGUI_BUTTONDOWN;
23
+	e.user.code = eventid;
24
+	SDL_PushEvent(&e);
25
+}

+ 0
- 1
glgui/window.h View File

@@ -30,7 +30,6 @@ class GLGuiWindow : public GLGuiObject {
30 30
 		void addItem(GLGuiObject*);
31 31
 		SDL_Rect getPos();
32 32
 		void render();
33
-
34 33
 };
35 34
 
36 35
 #endif

Loading…
Cancel
Save