GithubHelp home page GithubHelp logo

easysdl2's Introduction

EasySDL2

EasySDL2 is a single-file newbie-oriented wrapper for SDL2.

A lot of new programming students start with c++ and/or object oriented programming. Most of the time, all they do is make console programs, which is not very visual and usually boring. Most other graphics libraries and wrappers require the knoledge of pointers or set-ups that are not intended for newcomers. EasySDL2 hides set-up, configuration, and complex concepts susch as renderers and surfacers from the programmer.

This repo is still in active development as it is lacking some basic features, but it is functional and al contributions are welcome if they follow the same newbie aproach.

Some components, such as textures, are managed through smart pointers, so c++11 is required.

How to use

Windows and Visual studio

In your project, open nugget package manger and install SDL2, SDL_image and SDL_mixer. Include this hpp in your files On top of your .cpp file, add: #include "EasySDL2.hpp"

Basics

#include "EasySDL2.hpp"
using namespace std;

int main(int argc, char* argv[]) {

	EasySDL2 sdl(500, 500);                 //initialization
	Texture t = sdl.loadTexture("h.jpg");   //load texture
	sdl.drawTexture(t, 0, 0, 500, 500); 
	sdl.drawFrame();                        //show next frame
	sdl.waitUntil("Q");                     //show same frame until Q is pressed
	return 0;

}

easysdl2's People

Contributors

alvareziglesias avatar

Stargazers

Nekuake - Alejandro Hurtado avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.