nanobot Posted November 4, 2010 CID Share Posted November 4, 2010 Well, I have been learning some C++ and DirectX 9.0c (Long story) and I made a program. It loops from 0x00 to 0xBF characters and prints them on the screen. (The Black Box is actually an image I printed a bunch, I was testing FPS.) In that screenshot FPS is 29. (Probably because the code to loop through all those characters is in my Draw sub. Haven't bothered to move it yet.) Here is the code for that text. (Looping through all the digits. I know, I made the numbers in Hex.) Most of this is actually C. I am working on rewriting it. char buffer [10]; char string[1536] = ""; for (int a = 0x00000000; a <= 0x000000BF; ++a) { sprintf(buffer, "%X %c | ", a, a); strcat(string, buffer); } If anyone has any optimization strategies, I would be happy to know them. I can post the rest of the draw code if you want. Thanks, EBrown Quote Link to comment Share on other sites More sharing options...
nanobot Posted November 5, 2010 Author CID Share Posted November 5, 2010 Update, I have gotten it to take an array and render it. char oneA[100] = ""; strcat(oneA, "0"); char oneB[100] = ""; strcat(oneB, "1111111111111111111111111111111111111111"); char oneC[100] = ""; strcat(oneC, "0"); char twoA[100] = ""; strcat(twoA, "0"); char twoB[100] = ""; strcat(twoB, "1000000010001000100100101000100010100001"); char twoC[100] = ""; strcat(twoC, "0"); char threeA[100] = ""; strcat(threeA, "0"); char threeB[100] = ""; strcat(threeB, "1000000111111111100100111111111111110001"); char threeC[100] = ""; strcat(threeC, "0"); char fourA[100] = ""; strcat(fourA, "0"); char fourB[100] = ""; strcat(fourB, "1000001010001000100100101000100010001001"); char fourC[100] = ""; strcat(fourC, "0"); char fiveA[100] = ""; strcat(fiveA, "1111111111111111111111111111111111111111"); char fiveB[100] = ""; strcat(fiveB, "1111110010001000111111101000100010000111"); char fiveC[100] = ""; strcat(fiveC, "1111111111111111111111111111111111111111"); Basically, it renders an image in a certain color if that spot is a "1". In this screenshot FPS is 60. Thanks, EBrown Quote Link to comment Share on other sites More sharing options...
mudmanc4 Posted November 5, 2010 CID Share Posted November 5, 2010 Awesome , keep moving forward man ! Quote Link to comment Share on other sites More sharing options...
nanobot Posted November 5, 2010 Author CID Share Posted November 5, 2010 I am working on it. I got a few more things to learn about that program before I go farther into it. I plan to make it ENTIRELY native, you can either use DirectX or OpenGL. (I don't know if this is possible though.) Thanks, EBrown Quote Link to comment Share on other sites More sharing options...
nanobot Posted November 6, 2010 Author CID Share Posted November 6, 2010 Got some Alpha Blending done. (This screenshot is an image overlayed on top of the background, again, 60 FPS) The background image is actually 60,127,255, not the 30,64,128 that the image says. (That's what my Alpha did. ) I have to do a little bit of math to make my render screen 800x600 as opposed to the actual window being 800x600. Thanks, EBrown Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.