Jump to content
int main()
{
//std::cout << argc << std::endl << argv << std::endl;
#pragma region Setup
#pragma region Init Allegro, create display and install addons
//Initialize allegro and create a display
if(!al_init()) //initialize Allegro (if it fails to do, show error message and terminate
{
al_show_native_message_box(DisplayManager::GetInstance().GetDisplay(), "Error!", "Error!", "Couldn't initialize allegro 5", "Ok Sok", 0);
return -1;
}
DisplayManager::GetInstance().CreateDisplay();
 
//install addons
al_install_keyboard();
al_install_mouse();
al_install_joystick();
al_reconfigure_joysticks();
 
al_init_primitives_addon();
#pragma endregion
#pragma region Init Managers
//Initialize managers
GameObjectManager::GetInstance().Init();
ButtonManager::GetInstance().Init();
Pop_Up_Message::Init();
Background::GetInstance().Init();
LevelManager::GetInstance().Init();
#pragma endregion
gameTime = al_get_time();
srand(time(unsigned int(0)));
#pragma region Events and Timers
//Create event_queue and timer
ALLEGRO_EVENT_QUEUE *event_queue = al_create_event_queue();
ALLEGRO_TIMER *timer = al_create_timer(1.0 / FPS);
 
al_register_event_source(event_queue, al_get_timer_event_source(timer));
al_register_event_source(event_queue, al_get_keyboard_event_source());
al_register_event_source(event_queue, al_get_mouse_event_source());
al_register_event_source(event_queue, al_get_joystick_event_source());
al_register_event_source(event_queue, al_get_display_event_source(DisplayManager::GetInstance().GetDisplay()));
 
al_start_timer(timer);
 
#pragma endregion
#pragma endregion Setting up the game before entering the loop (declaring variables, initing allegro, installing addons, registering event sources)
 
#pragma region Main Game Loop
while(!Exit::GetDone())
{
//std::cout << "entered main loop" << std::endl;
ALLEGRO_EVENT ev;
al_wait_for_event(event_queue, &ev);
GetInput(ev);
#pragma region Timer event
if(ev.type == ALLEGRO_EVENT_TIMER)
{
render = true;
UpdateTime();
if(_keys_pressed[R_KEY])
LevelManager::GetInstance().RestartLevel();
 
if(_keys_pressed[Q_KEY] && GameObjectManager::GetInstance().D_object_exists(PLAYER))
GameObjectManager::GetInstance().KillPlayer();
 
if(_keys_pressed[M_KEY])
{
SoundManager::GetInstance().ToggleMusic();
FileManager::GetInstance().SaveSettings();
std::stringstream ss;
ss << "Music: ";
if(SoundManager::GetInstance().GetMusicEnabled())
ss << "Enabled";
else
ss << "Disabled";
Pop_Up_Message::NewMessage(ss.str());
}
if(_keys_pressed[s_KEY])
{
SoundManager::GetInstance().ToggleSound();
FileManager::GetInstance().SaveSettings();
std::stringstream ss;
ss << "Sound: ";
if(SoundManager::GetInstance().GetSoundEnabled())
ss << "Enabled";
else
ss << "Disabled";
Pop_Up_Message::NewMessage(ss.str());
}
 
Background::GetInstance().Update();
GameObjectManager::GetInstance().TimerEvent();
ButtonManager::GetInstance().TimerEvent();
SoundManager::GetInstance().Update();
Pop_Up_Message::Update();
 
CheckIfCamIsChanged();
 
_camX_prev=_camX;
_camY_prev=_camY;
 
if(DisplayManager::GetInstance().GetState() == DisplayManager::WINDOWED)
{
_mouseX=mX+_camX;
_mouseY=mY+_camY;
}
else if(DisplayManager::GetInstance().GetState() == DisplayManager::FULLSCREEN_WINDOW)
{
_mouseX = ((mX - (_monitorWidth - (_SCREEN_WIDTH * _scaleScreen))/2.0)/_scaleScreen)+_camX;
_mouseY = ((mY - (_monitorHeight - (_SCREEN_HEIGHT * _scaleScreen))/2.0)/_scaleScreen)+_camY;
}
 
ResetKeys();
 
//al_unlock_mutex(data->mutex);
}
#pragma endregion This is where the magic happens ;)
#pragma region Draw
if(render && al_is_event_queue_empty(event_queue) || (render && !GetDropFrames()))
{
//std::cout << "draw" << std::endl;
//al_lock_mutex(data.mutex);
UpdateFPS();
render = false;
 
al_set_target_backbuffer(DisplayManager::GetInstance().GetDisplay());
al_clear_to_color(al_map_rgb(192,192,192));
 
//Draw all the objects
Background::GetInstance().Draw();
GameObjectManager::GetInstance().Draw();
ButtonManager::GetInstance().Draw();
Pop_Up_Message::Draw();
 
//al_draw_textf(FontManager::GetInstance().GetFont(0), al_map_rgb(255,255,255), 10, 10, 0, "FPS: %f", gameFPS);
 
DrawBorders();
 
//al_unlock_mutex(data.mutex);
al_flip_display();
}
#pragma endregion All drawing stuff happens in here
}
#pragma endregion
//al_destroy_thread(thread);
 
return Exit::GetReturnValue();
}

 

It's the main function in a game I am making...
Totally forgot I had it copied xD

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-315359
Share on other sites

Link to post
Share on other sites

Dell Inspiron 580 - Modified

Build log

Win 7 | GTX 760 | i5 CPU 650 @ 3.20GHz | 2x2Gb 1333MHz Hyundai + 2x2Gb 1333Mhz Crucial RAM | Seagate 1TB 7200RPM | HyperX Fury 120Gb | Corsair Builder 600M | Fractal R2 Mini

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-315392
Share on other sites

Link to post
Share on other sites

Howard Leight Max

 

i was looking for some ear plugs on amazon 

CPU: AMD PHENOM II X4 945 GPU: AMD 7850 (ASUS) RAM: CORSAIR VANGEANCE LP 8GB CPU COOLER: CM HYPER 212(old one) HDD: SAMSUNG 500GB PSU: MODECOM CARBON 530W MB: GIGABYTE GA-MA770T-UD3P KB: CMSTORM QUICKFIRE RAPID MOUSE: CORSAIR M60 SPEAKERS: LOGITECH LS21

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-315541
Share on other sites

Link to post
Share on other sites

Paranormal events with Brownninja97

Haha that was a for a thread.

cpu: intel i5 4670k @ 4.5ghz Ram: G skill ares 2x4gb 2166mhz cl10 Gpu: GTX 680 liquid cooled cpu cooler: Raijintek ereboss Mobo: gigabyte z87x ud5h psu: cm gx650 bronze Case: Zalman Z9 plus


Listen if you care.

Cpu: intel i7 4770k @ 4.2ghz Ram: G skill  ripjaws 2x4gb Gpu: nvidia gtx 970 cpu cooler: akasa venom voodoo Mobo: G1.Sniper Z6 Psu: XFX proseries 650w Case: Zalman H1

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-315717
Share on other sites

Link to post
Share on other sites

AMD A10-5800K APU

Was gathering a list of components for neighbors computer. :P

CPU - I7 4770k @ 4.3GHz GPU - EVGA Nvidia GeForce GTX 780 Motherboard - ASUS Maximus VI Extreme RAM - 16GB of Corsair Dominator Platinum @ 2133MHz  Case - Corsair 800D PSU - Corsair AX1,200i CPU Cooler - Custom Liquid CPU Cooler SSD - Samsung 840 Pro 256GB Hard Drive - Western Digital Black 1TB.

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-315873
Share on other sites

Link to post
Share on other sites

I pasted it here, but had to delete it. It's a serial key for a program that I still intend to use :D. Also was a bit worried that it will be my story of one of the Adventure Time episodes... :D

CPU: AMD Ryzen 9 5900X 12; GPU: GeForce RTX 3080 Gigabyte Vision OC V2 10GB; PSU: EVGA 750W 80+ Gold Certified; RAM: 4x32GB (w/RGB xd); SSD: 1xM.2 Samsung 980 Pro 1TB, 1xM.2 Samsung 970 Pro 1TB, 1xWD 6TB HDD; OS: 10; Monitor: 1xAorus IPS 27" (2560x1400) 1xBenq IPS 32" 4kKeyboard: Corsair K95; Mouse: Logitech G Pro X Superlight w/ Steelseries QcK mousepad.

Laptop - HP Omen 15" w/5800U, GPU 3070, 1TB M.2 WD Black, 2TB M.2 Samsung 980 Pro, 64GB RAM.

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-316376
Share on other sites

Link to post
Share on other sites

WHTA THE FUJCK""

 

Okay....that was random

i7 5960X OC 4.40Ghz II GTX 1080 Asus Stryx II X99S Gaming 7 MSI II 16GB Vengence DDR4 II 250GB Samsung 850 II 3x 1 TB HDD WD II 

Designer by Heart, Gamer by Blood

Send me a PM if you want a custom Profile Pic or Background!  --

If you like what I made you , share it with everyone In this thread Here!

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-316382
Share on other sites

Link to post
Share on other sites

Spoiler

AMD R7 1800X, H100i GTX, AMD Radeon RED DEVIL 5700XT, ASUS STRIX B350-F GAMING, 16gb DDR4 3000, 1Tb, 2 X SEAGATE 1Tb, Coolermaster V1200 Platinum, NZXT H440 red/black, STEEL SERIES AEROX 3, DUCKY X POWER COLOR RED DEVIL KEYBOARD, Microsoft xbox 360 wired controller, LG ULTRAWIDE.

 

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-317189
Share on other sites

Link to post
Share on other sites

Well low res gaming is what you are gonna have to do with the 650m or Iris 5200. It does drop off once you hit 1600x900 or more. The thing is, most instances of the 650m are for the need for a GPU that can push high res well (MBPr and iMac). Many ultrabooks and thin and lights will also switch over because most have the 640m or integrated, but with the Iris 5200 parts, you can have less heat and power usage than a dualcore and 640m and Iris 5200 is in a quadcore.

 

So me talking about Haswell on reddit. Not surprised.

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-317207
Share on other sites

Link to post
Share on other sites

Type III Polyketide Synthase β-Ketoacyl-ACP Starter Unit and Ethylmalonyl-CoA Extender Unit Selectivity Discovered by Streptomyces coelicolor Genome Mining

 

at work.. taking a break :D

CPU: Intel 2700k (4.7) MOBO: Asus P8Z77-V DELUXE GPU: Sapphire Vapor-X R9 290X RAM: 16GB Corsair Vengence (1866) CPU Cooler: Corsair H100i w/ 2x Noctua NF-F12 Storage: 256GB Samsung 830 Pro SSD (Boot), 64GB Crucial M4 (SSD Cache), 1TB WD Black Cavier, 2TB Hitachi, 2.5TB Buffalo Sound Card: Xonar Essence STX Case: Corsair Graphite 600t w/ full acrylic side PSU: Corsair HX750 (individually sleeved) 
Peripherals: Filco Keyboard (Brown) Razer Deathadder, Sennheiser HD595, Zalman ZM-MIC1, Steelseries Qck Mass mousepad.
Pics of my Rig

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-318037
Share on other sites

Link to post
Share on other sites

// server name
hostname "Garry's Mod Server"

// rcon passsword
rcon_password "muffin"

// Server password
sv_password "hej"            

 

Old passwords 

If you want to join a really cool Discord chatroom with some great guys here from LTT and outside this community then PM me!

Link to comment
https://linustechtips.com/topic/2240-ctrl-v-game/page/10/#findComment-318746
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×