Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Texture Previewer

Display your little helpful snippets of code that may help us all get something done

Texture Previewer

Postby glinka57 on Sun Oct 11, 2009 3:29 pm

Preview textures using the ascii chart.

Code: Select all
//Texture Previewer

#include "stdafx.h"
#include <iostream>
using namespace std;
#include <windows.h> 

void gotoxy ( short x, short y ) //windows.h
{
  COORD coord = {x, y};
  SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), coord );
}


void main()               
{
   system("color F0");
   int  D=0;
   char d=D;

   while(d<=300)
   {
      gotoxy(0,0);
      for(int x=0;x<1920;x++){cout<<d;}
      gotoxy(13,24);cout<<"   ";gotoxy(73,24);cout<<"   ";
      gotoxy(73,24);cout<<D;
     
   
      for(int x=0;x==0;)
      {
         gotoxy(0,24);
         cout<<"Enter Number:";
         cin>>D;
         if(D<255&&D>-1){x=1;}
         if(D>255||D<0||D==7)
         {
            gotoxy(0,24);cout<<"Error: Characters Range From 0-255";Sleep(2000);
            gotoxy(0,24);cout<<"                                  ";
         
         }
     
      }

      if(D==999)break;
      d=D;cout<<d;
     if(D==7)d=0;
     
   }
}
Last edited by glinka57 on Sun Oct 11, 2009 7:00 pm, edited 3 times in total.
User avatar
glinka57
 
Posts: 195
Joined: Fri Feb 27, 2009 7:32 pm

Re: Texture Previewer

Postby noobgrammer on Sun Oct 11, 2009 4:35 pm

That's a neat way of doing it I just do a for loop to see them all

Be warned DO NOT ENTER 7

that is the bell
I had to kill it in task managers process part it wasn't shutting off under applications in task manager

I'm running Windows 7 64bit so I don't know if its just me

just warning you

EDIT glinka57 fixed it
Last edited by noobgrammer on Sun Oct 11, 2009 7:19 pm, edited 1 time in total.
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Texture Previewer

Postby glinka57 on Sun Oct 11, 2009 6:51 pm

HOLY SMOKES! Had to fix it in a hurry, the above code is now good. Thanks lol
User avatar
glinka57
 
Posts: 195
Joined: Fri Feb 27, 2009 7:32 pm


Return to Snippets

Who is online

Users browsing this forum: No registered users and 0 guests