Jump to content
  • Advertisement
Sign in to follow this  
pumukix

How to create static library with sdl?

This topic is 3495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have this codes and i want to know what i have to do to create the static library, the function have more functions inside. I'm using devc++ compiler and i want to know what type of project I have to create in every file. Header "sdl project"? The specification function a "static library"? This is the main code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SDL/SDL.h>
#include <windows.h>
#include <stdlib.h>
#include <SDL/SDL_ttf.h>
#include "control.h"

......

ControlTeclado();
 
...... 


This is the header:
int ControlTeclado(void); 


This is the function:
#include "control.h"

int ControlTeclado(void)
{           
      SDL_PumpEvents();
      keystate = SDL_GetKeyState(NULL); 
         
       if(keystate[SDLK_RIGHT]) 
       {
        x=x+10 ;
        orientacion= 4;
        if (estado==1)
        {
        Crono=SDL_LoadBMP("Cronod2.bmp");
        estado=2;
        }
        else
        {
        Crono=SDL_LoadBMP("Cronod1.bmp");
        estado=1;
        }
       } 
       
       if(keystate[SDLK_LEFT])
       {
       x=x-10 ;
       orientacion= 3;
        if (estado==1)
        {
        Crono=SDL_LoadBMP("Cronoi2.bmp");
        estado=2;
        }
        else
        {
        Crono=SDL_LoadBMP("Cronoi1.bmp");
        estado=1;
        }
       }
        
       if(keystate[SDLK_UP]) 
       {
        y  =y-10  ; 
        orientacion= 1;
        if (estado==1)
        {
        Crono=SDL_LoadBMP("Cronoup2.bmp");
        estado=2;
        }
        else
        {
        Crono=SDL_LoadBMP("Cronoup1.bmp");
        estado=1;
        }
       }
       if(keystate[SDLK_DOWN]) 
       {
       y=y+10 ;
       orientacion= 2;
        if (estado==1)
        {
        Crono=SDL_LoadBMP("Cronodown2.bmp");
        estado=2;
        }
        else
        {
        Crono=SDL_LoadBMP("Cronodown1.bmp");
        estado=1;
        }
       }        
}


Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!