Original Post
I'm currently learning how to code emulators, I've started with a Chip 8 emu from scratch using the awesome documentation about them on the net. I'm at the point where my emu runs and I can see the debug output and see it executing all the opcodes. My screen info is stored in a char array which represents the 64x32 resolution of the Chip8 so:
unsigned char screen[2047] Each char in the array is either 1 for on or 0 for off. Now what I need to do is loop through this array and draw it to the screen, so draw 64 chars at 1-64,0 then draw the next 64 chars at 1-64,1 then the next at 1-64,2 etc until I get to 64,31. Then I want to display that on the screen. I've been told I need to create a texture and an object to apply it to i.e. a rect, then each update I want to lock the texture, clear it out, plot my pixels depending on what's in the char array, unlock the texture and render the rect with the texture applied to it. I'd obviously increase each char to say take up 4 or 8 pixels so I can increase the screen size but I can handle that. What I've done so far is create my d3d device and implement a simple update and render loop which at the moment just clears the screen and redraws it. I'm really stuck when it comes to creating the texture and the object and plotting the pixels. I've been on Google that last few hours and come up with nothing. So if anyone has any experience with DX9 then I'd really appreciate some advice or a helping hand (This has to be done using dx9).