initial commit
This commit is contained in:
38
main_class.cpp
Normal file
38
main_class.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <SDL2/SDL_timer.h>
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include "scope.h"
|
||||
|
||||
// Main window
|
||||
main_window_class::main_window_class (int x_main_window_size, int y_main_window_size)
|
||||
{
|
||||
if ((window_for_main = SDL_CreateWindow("Audio Analyzer",
|
||||
0, 0, x_main_window_size, y_main_window_size, 0)) == NULL) {
|
||||
printf("error opening main window SDL: %s\n", SDL_GetError());
|
||||
exit (0);
|
||||
}
|
||||
|
||||
//if ((call_result = SDL_SetWindowFullscreen(window_for_main,
|
||||
// SDL_WINDOW_FULLSCREEN_DESKTOP)) !=0) {
|
||||
// printf("error setting main to fullscreen SDL: %s\n", SDL_GetError());
|
||||
// exit (0);
|
||||
//}
|
||||
|
||||
SDL_SetWindowBordered(window_for_main, SDL_FALSE);
|
||||
|
||||
if ((renderer_for_main = SDL_CreateRenderer(window_for_main, -1, 0)) == NULL) {
|
||||
printf("error opening main renderer SDL: %s\n", SDL_GetError());
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
||||
SDL_SetRenderDrawColor(renderer_for_main, (Uint8)30, (Uint8)50, (Uint8)50, (Uint8)255);
|
||||
SDL_RenderClear(renderer_for_main);
|
||||
SDL_RenderPresent(renderer_for_main);
|
||||
}
|
||||
Reference in New Issue
Block a user