diff options
-rw-r--r-- | gfx.cpp | 9 | ||||
-rw-r--r-- | gfx.o | bin | 9008 -> 9328 bytes | |||
-rw-r--r-- | gui.cpp | 3 | ||||
-rw-r--r-- | gui.o | bin | 92736 -> 92744 bytes | |||
-rw-r--r-- | libgfx.a | bin | 9470 -> 9840 bytes | |||
-rw-r--r-- | libgui.a | bin | 103782 -> 103790 bytes |
6 files changed, 9 insertions, 3 deletions
@@ -4,6 +4,8 @@ SDL_Window *mwindowp; // main window were everything foes SDL_DisplayMode * screenp; SDL_Renderer * renderp; TTF_Font * fontp; +SDL_Surface * msurface; +bool surface; int maxx; int maxy; int initgfx(int x, int y,const char * title) { @@ -34,6 +36,9 @@ int initgfx(int x, int y,const char * title) { } return 0; } +int surfacerender(int w, int h) { + msurface = SDL_CreateRGBSurface(0, w, h, 32, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff); +} //two draw functions for convenience int drawimg(int x, int y, int w, int h,SDL_Texture * tex) { SDL_Rect r; @@ -55,7 +60,7 @@ SDL_Texture * loadtexture(const char * file) { SDL_Texture * ttp; tsp = SDL_LoadBMP(file); ttp = SDL_CreateTextureFromSurface(renderp, tsp); - SDL_SetTextureBlendMode(ttp, SDL_BLENDMODE_ADD); + SDL_SetTextureBlendMode(ttp, SDL_BLENDMODE_BLEND); SDL_FreeSurface(tsp); return ttp; } @@ -98,7 +103,7 @@ int drawrect (int x, int y, int w, int h,int r, int g, int b, int a) { rect.w = w; rect.h = h; SDL_SetRenderDrawColor(renderp,r,g,b,a); - SDL_SetRenderDrawBlendMode(renderp, SDL_BLENDMODE_ADD); + SDL_SetRenderDrawBlendMode(renderp, SDL_BLENDMODE_BLEND); SDL_RenderFillRect(renderp,&rect); SDL_SetRenderDrawColor(renderp,0,0,0,255); return 0; Binary files differ@@ -63,8 +63,9 @@ int butt::press(int x, int y) { int c = boxes.check(x, y); if (c != -1) { states[c] = states[c] ^ TOGGLE; + return 0; } - return 0; + return -1; } //doesn't do anything for now because just press will do the trick int butt::unpress(int index) { Binary files differBinary files differBinary files differ |