mirror of
				https://github.com/Clortox/dashboard.git
				synced 2025-07-17 14:02:10 +00:00 
			
		
		
		
	Add proper clock and colors
This commit is contained in:
		
							parent
							
								
									906a6dc65d
								
							
						
					
					
						commit
						8d8751e4d8
					
				@ -368,27 +368,25 @@ void board::start(){
 | 
			
		||||
        SDL_RenderClear(_renderer);
 | 
			
		||||
 | 
			
		||||
        //PLACEHOLDER, cycle color
 | 
			
		||||
        /*
 | 
			
		||||
        {
 | 
			
		||||
            static uint8_t red = 0;
 | 
			
		||||
            static uint8_t green = 0;
 | 
			
		||||
            static bool up = true;
 | 
			
		||||
 | 
			
		||||
            SDL_SetRenderDrawColor(_renderer, red, 
 | 
			
		||||
                    BOARD_GREEN, BOARD_BLUE, SDL_ALPHA_OPAQUE);
 | 
			
		||||
            SDL_SetRenderDrawColor(_renderer, BOARD_RED, 
 | 
			
		||||
                    green, BOARD_BLUE, SDL_ALPHA_OPAQUE);
 | 
			
		||||
 | 
			
		||||
            SDL_RenderClear(_renderer);
 | 
			
		||||
 | 
			
		||||
            if(up){
 | 
			
		||||
                if(red == 254)
 | 
			
		||||
                if(green == 254)
 | 
			
		||||
                    up = false;
 | 
			
		||||
                red++;
 | 
			
		||||
                green++;
 | 
			
		||||
            } else {
 | 
			
		||||
                if(red == 1)
 | 
			
		||||
                if(green == 1)
 | 
			
		||||
                    up = true;
 | 
			
		||||
                red --;
 | 
			
		||||
                green --;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        */
 | 
			
		||||
        //END PLACEHOLDER
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -115,8 +115,8 @@ void def_overlay::update_texture() {
 | 
			
		||||
    TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 28 }),
 | 
			
		||||
            date_time.c_str(),
 | 
			
		||||
            &tgt.w, &tgt.h);
 | 
			
		||||
    tgt.x = SCREEN_WIDTH - tgt.w - 5;
 | 
			
		||||
    tgt.y = 0;
 | 
			
		||||
    tgt.x = SCREEN_WIDTH - tgt.w + 25;
 | 
			
		||||
    tgt.y = -5;
 | 
			
		||||
    SDL_RenderCopy(board::getRenderer(),
 | 
			
		||||
            board::getString(date_time.c_str(),
 | 
			
		||||
                { "Roboto_Mono/RobotoMono-Medium.ttf", 28 }), NULL, &tgt);
 | 
			
		||||
@ -124,7 +124,6 @@ void def_overlay::update_texture() {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    SDL_SetRenderTarget(board::getRenderer(), NULL);
 | 
			
		||||
 | 
			
		||||
    //reset back to the old render color
 | 
			
		||||
 | 
			
		||||
@ -11,10 +11,10 @@
 | 
			
		||||
namespace dashboard::panel {
 | 
			
		||||
    //How long should we wait between updates? in ms
 | 
			
		||||
    //Default 10 s
 | 
			
		||||
    constexpr size_t DEF_OVERLAY_UPDATE_INTERVAL = 10000;
 | 
			
		||||
    constexpr size_t DEF_OVERLAY_UPDATE_INTERVAL = 500;
 | 
			
		||||
 | 
			
		||||
    //Height of the bar on the top and bottom, in pixels
 | 
			
		||||
    constexpr size_t DEF_OVERLAY_BAR_HEIGHT = 45;
 | 
			
		||||
    constexpr size_t DEF_OVERLAY_BAR_HEIGHT = 60;
 | 
			
		||||
 | 
			
		||||
    //Text color
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_TEXT_RED    = 0xCC;
 | 
			
		||||
@ -22,8 +22,8 @@ namespace dashboard::panel {
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_TEXT_BLUE   = 0xCC;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_TEXT_ALPHA  = 0xFF;
 | 
			
		||||
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_RED     = 0xAA;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_GREEN   = 0xAA;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_BLUE    = 0xAA;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_ALPHA   = 0xFF;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_RED     = 0x00;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_GREEN   = 0x00;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_BLUE    = 0x00;
 | 
			
		||||
    constexpr uint8_t DEF_OVERLAY_BAR_ALPHA   = 0xCC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -132,6 +132,6 @@ void weather::initTexture(){
 | 
			
		||||
                SDL_TEXTUREACCESS_TARGET, 
 | 
			
		||||
                SCREEN_WIDTH, SCREEN_HEIGHT);
 | 
			
		||||
 | 
			
		||||
        SDL_SetTextureBlendMode(_texture, SDL_BLENDMODE_NONE);
 | 
			
		||||
        SDL_SetTextureBlendMode(_texture, SDL_BLENDMODE_BLEND);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user