Advertisement
Francescoo

libreria grafica

Dec 13th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <Windows.h>
  4.  
  5. namespace grp{
  6.  
  7.     inline void SetColor(unsigned short a) {
  8.    
  9.         HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
  10.         SetConsoleTextAttribute(h, a);
  11.     }  
  12.  
  13.         inline void gotoxy(int x, int y){
  14.    
  15.          COORD coordinates;    
  16.          coordinates.X = x;    
  17.          coordinates.Y = y;    
  18.         SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coordinates);  
  19.            
  20.         }
  21.        
  22.             void ShowColorInfo(){
  23.                
  24.                 int index = 0;
  25.                
  26.                 while(index < 8191){
  27.                    
  28.                     std::cout<<" Test "<<std::endl;
  29.                     SetColor(index);
  30.                     std::cout<<" - "<<index;
  31.                     index++;
  32.                 }
  33.             }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement