whatever added include;src;whatever.h;updated makefile
This commit is contained in:
parent
c6d1a1eadf
commit
bec2261d1d
@ -1,7 +1,7 @@
|
|||||||
PREFIX=/usr
|
PREFIX=/usr
|
||||||
|
|
||||||
#OBJS specifies which files to compile as part of the project
|
#OBJS specifies which files to compile as part of the project
|
||||||
OBJS = whatever.c
|
OBJS = src/whatever.c
|
||||||
|
|
||||||
#CC specifies which compiler to use
|
#CC specifies which compiler to use
|
||||||
CC = clang
|
CC = clang
|
||||||
@ -16,9 +16,12 @@ LINKER_FLAGS = -lSDL2
|
|||||||
#OBJ_NAME specifies the name of our executable
|
#OBJ_NAME specifies the name of our executable
|
||||||
OBJ_NAME= whatever
|
OBJ_NAME= whatever
|
||||||
|
|
||||||
|
#INCLUDES where the INCLUDE directory is
|
||||||
|
INCLUDES = -I./include
|
||||||
|
|
||||||
#This is the target that compiles our executable
|
#This is the target that compiles our executable
|
||||||
all : $(OBJS)
|
all : $(OBJS)
|
||||||
$(CC) $(OBJS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)
|
$(CC) $(OBJS) $(COMPILER_FLAGS) $(INCLUDES) $(LINKER_FLAGS) -o $(OBJ_NAME)
|
||||||
install :
|
install :
|
||||||
mkdir -p ${PREFIX}/share/${OBJ_NAME}
|
mkdir -p ${PREFIX}/share/${OBJ_NAME}
|
||||||
cp ${OBJ_NAME} ${PREFIX}/share/${OBJ_NAME}/
|
cp ${OBJ_NAME} ${PREFIX}/share/${OBJ_NAME}/
|
||||||
|
44
sdl/whatever/include/whatever.h
Normal file
44
sdl/whatever/include/whatever.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#ifndef WHATEVER_H
|
||||||
|
#define WHATEVER_H
|
||||||
|
/* start SDL and create a window */
|
||||||
|
int init();
|
||||||
|
|
||||||
|
/* load the media durr */
|
||||||
|
int loadMedia();
|
||||||
|
|
||||||
|
/* Free the surfaces and whatnot */
|
||||||
|
void close_game();
|
||||||
|
|
||||||
|
/* Our main window */
|
||||||
|
SDL_Window* gScreen;
|
||||||
|
|
||||||
|
/* Our renderer */
|
||||||
|
SDL_Renderer* gRenderer;
|
||||||
|
|
||||||
|
|
||||||
|
/*screen dimensions*/
|
||||||
|
const int screen_width = 1024;
|
||||||
|
const int screen_height = 768;
|
||||||
|
|
||||||
|
/* Surface for loading BMP */
|
||||||
|
SDL_Surface* gTemp;
|
||||||
|
|
||||||
|
/* Texture for background */
|
||||||
|
SDL_Texture* gBackground_texture;
|
||||||
|
|
||||||
|
/* Texture for characters */
|
||||||
|
SDL_Texture* gPlayer;
|
||||||
|
|
||||||
|
/* Player coors */
|
||||||
|
SDL_Rect gPlayer_dest = { 0 };
|
||||||
|
|
||||||
|
/* Gamepads ! */
|
||||||
|
SDL_Joystick* gGameController = NULL;
|
||||||
|
|
||||||
|
/* deadzone, we don't want light taps to do anything */
|
||||||
|
const int JOYSTICK_DEAD_ZONE = 8000;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -1,46 +1,12 @@
|
|||||||
#include "SDL2/SDL.h"
|
#include "SDL2/SDL.h"
|
||||||
|
|
||||||
|
#include "whatever.h"
|
||||||
|
|
||||||
//Write a function that moves an image based on which arrow keys are pressed.
|
//Write a function that moves an image based on which arrow keys are pressed.
|
||||||
//something like
|
//something like
|
||||||
//functionize, everything
|
//functionize, everything
|
||||||
//void move_image(direction, image);
|
//void move_image(direction, image);
|
||||||
|
|
||||||
/* start SDL and create a window */
|
|
||||||
int init();
|
|
||||||
|
|
||||||
/* load the media durr */
|
|
||||||
int loadMedia();
|
|
||||||
|
|
||||||
/* Free the surfaces and whatnot */
|
|
||||||
void close_game();
|
|
||||||
|
|
||||||
/* Our main window */
|
|
||||||
SDL_Window* gScreen;
|
|
||||||
|
|
||||||
/*screen dimensions*/
|
|
||||||
const int screen_width = 1024;
|
|
||||||
const int screen_height = 768;
|
|
||||||
|
|
||||||
/* Our renderer */
|
|
||||||
SDL_Renderer* gRenderer;
|
|
||||||
|
|
||||||
/* Surface for loading BMP */
|
|
||||||
SDL_Surface* gTemp;
|
|
||||||
|
|
||||||
/* Texture for background */
|
|
||||||
SDL_Texture* gBackground_texture;
|
|
||||||
|
|
||||||
/* Texture for characters */
|
|
||||||
SDL_Texture* gPlayer;
|
|
||||||
|
|
||||||
/* Player coors */
|
|
||||||
SDL_Rect gPlayer_dest = { 0 };
|
|
||||||
|
|
||||||
/* Gamepads ! */
|
|
||||||
SDL_Joystick* gGameController = NULL;
|
|
||||||
|
|
||||||
/* deadzone, we don't want light taps to do anything */
|
|
||||||
const int JOYSTICK_DEAD_ZONE = 8000;
|
|
||||||
|
|
||||||
int main ( int argc, char *argv[] )
|
int main ( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
/* How fast our player moves */
|
/* How fast our player moves */
|
Loading…
x
Reference in New Issue
Block a user