diff --git a/Makefile b/Makefile index b900815..3d9f286 100755 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ COMPILER = g++ 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 VERSION = 0.0.1 +LIBNAME = segl sgllib: $(OBJECTS) sglar: $(OBJECTS) - rm -f sgllib.a - ar rfc sgllib.a $(OBJECTS) + rm -f lib$(LIBNAME).a + ar rfc lib$(LIBNAME).a $(OBJECTS) %.o: %.cpp %.h $(COMPILER) -c `sdl-config --cflags` $< diff --git a/glgui/button.cpp b/glgui/button.cpp index 512a29c..2b4ca71 100644 --- a/glgui/button.cpp +++ b/glgui/button.cpp @@ -16,3 +16,10 @@ GLGuiButton::GLGuiButton(int _eventid, std::string str, int _x, int _y, bool _ce void GLGuiButton::onMouseOver(int m_x, int m_y) { // Längste stelle finden, dann collision } + +void GLGuiButton::onMouseClick(int m_x, int m_y, int m_button) { + SDL_Event e; + e.type = GLGUI_BUTTONDOWN; + e.user.code = eventid; + SDL_PushEvent(&e); +} diff --git a/glgui/window.h b/glgui/window.h index 3c3b94e..09a8c31 100644 --- a/glgui/window.h +++ b/glgui/window.h @@ -30,7 +30,6 @@ class GLGuiWindow : public GLGuiObject { void addItem(GLGuiObject*); SDL_Rect getPos(); void render(); - }; #endif