-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
What's happening?
Here's the code (most of it's from Maze.cpp but I was trying to play around with Terminate and learn it)
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <Terminate/terminate.hpp>
#include <Terminate/sdl/context.hpp>
const Term::Color BGCOLOR( 255,200,0 );
const Term::Color FONTCOLOR(0,0,0);
int
main( int argc, char* argv[] )
{
SDL_Init( SDL_INIT_VIDEO );
atexit( SDL_Quit );
atexit( IMG_Quit );
Term::SDL::Context term( 200, 100 );
term.Tilemap( "tileset.png" );
SDL_Surface* screen = SDL_SetVideoMode(
term.Framebuffer().Width() * term.TileWidth(),
term.Framebuffer().Height() * term.TileHeight(),
32, SDL_SWSURFACE );
term.RenderTarget( screen );
term.Framebuffer().ClearChar( Term::Char('\0', 0, BGCOLOR, FONTCOLOR));
term.Framebuffer().Clear();
Term::TTY tty(term.Framebuffer());
tty.Set( Term::TTY::VScroll );
tty.Set( Term::TTY::Wrap );
tty.PriColor( BGCOLOR );
tty.SecColor( FONTCOLOR );
bool running = true;
srand (time(NULL));
while(running)
{
SDL_Event event;
while( SDL_PollEvent(&event) ) switch(event.type)
{
case SDL_QUIT:
case SDL_KEYDOWN:
running = false; break;
}
tty.Put("me@mehost ~/Downloads/Terminate-master/build/demo $" + std::to_string(rand()) + "\n");
term.Print();
SDL_Flip(screen);
SDL_Delay(500);
term.Framebuffer().Clear();
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels