]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Merge remote-tracking branch 'origin/master'
authorAndy Belle-Isle <abelleisle@roadrunner.com>
Mon, 7 Sep 2015 14:14:13 +0000 (10:14 -0400)
committerAndy Belle-Isle <abelleisle@roadrunner.com>
Mon, 7 Sep 2015 14:14:13 +0000 (10:14 -0400)
Conflicts:
src/main.cpp

1  2 
src/main.cpp

diff --cc src/main.cpp
index 95af0a7d6f57a5ca4d8c812ff6f200c69f1d1efe,cd3f624fec6014bc87469af49c3429568ea438ce..8d2d5373bada828edc1a758366434bcd392e48ff
@@@ -1,70 -1,7 +1,79 @@@
++<<<<<<< HEAD
 +#include <iostream>
 +#include "SDL.h"
 +#include "SDL_opengl.h"
 +
 +bool gameRunning = true;
 +
 +#define SCREEN_WIDTH 1280
 +#define SCREEN_HEIGHT 720
 +//#define FULLSCREEN
 +
 +    //window be rendered to
 +    SDL_Window* window = NULL;
 +    SDL_Surface* renderSurface = NULL;
 +    SDL_GLContext mainGLContext = NULL;
 +    SDL_Renderer* gRenderer = NULL;
 +
 +    const float sh = SCREEN_HEIGHT;
 +    const float sw = SCREEN_WIDTH;
 +
 +#include "gameHeader.h"
 +
 +
 +int main(int argc, char** argv){
 +    //runs startup procedures
 +    if(SDL_Init(SDL_INIT_VIDEO) < 0){
 +            std::cout << "SDL was not able to initialize! Error: " << SDL_GetError() << std::endl;
 +        }else{
 +            //Turn on double Buffering
 +            SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
 +            //create the window
 +            window = SDL_CreateWindow("Sword Swinger", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL
 +                                      #ifdef FULLSCREEN
 +                                        | SDL_WINDOW_FULLSCREEN
 +                                      #endif // FULLSCREEN
 +                                      );
 +            if(window == NULL){
 +                std::cout << "The window failed to generate! Error: " << SDL_GetError() << std::endl;
 +            }else{
 +                //set opengl context
 +                mainGLContext = SDL_GL_CreateContext(window);
 +                if(mainGLContext == NULL){
 +                    std::cout << "The OpenGL context failed to initialize! Error: " << SDL_GetError() << std::endl;
 +                }else{
 +                    //get window surface
 +                    renderSurface = SDL_GetWindowSurface(window);
 +                    //set renderer
 +                    gRenderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
 +                    if(gRenderer == NULL){
 +                        std::cout << "The variable 'gRenderer' was not able to initialize! Error: " << SDL_GetError() << std::endl;\
 +                    }
 +                    //background white
 +                    SDL_FillRect(renderSurface, NULL, SDL_MapRGB(renderSurface->format, 0xFF, 0xFF, 0xFF));
 +
 +                    //update window
 +                    SDL_UpdateWindowSurface(window);
 +
 +                    configRender();
 +                    gameLoop();
 +                }
 +            }
 +
 +        }
 +
 +
 +    //closes the window and frees resources
 +    SDL_GL_DeleteContext(mainGLContext);
 +    SDL_DestroyWindow(window);
 +    SDL_Quit();
 +    return 0;
++=======
+ #include <stdio.h>
+ #include <SDL2/SDL.h>
+ int main(int argc,char **argv){
+       puts("Hello, world!");
+       return 0;
++>>>>>>> origin/master
  }