What's new

Question about 2D rendering

Teamz

J'aime tes seins
ok I have a window application with cpu emulation implemented, now I need some advice for displaying 2D graphics

what API should I use ?
what are the main structures and methods that I need to use

I need programming advices, not technical infos plz
 

sketzh

New member
Teamz said:
ok I have a window application with cpu emulation implemented, now I need some advice for displaying 2D graphics

what API should I use ?
what are the main structures and methods that I need to use

I need programming advices, not technical infos plz

If it was me I was going to use DirectX.
It supports not only 2D, but also 3D, music, sound, input etc..

There are some very useful samples on the SDK, that lets you get started fast.
 

Cyberman

Moderator
Moderator
You can use OGL DirectX if you are on a windoze machine Or X etc.

It really depends on what you plan on doing!
If all you are doing is 2d stuff.. OGL will work (most cards are a bit slow with this especially ATI cards which have crappy 2d support).

However OGL is a bit more involved. Me I would use what library came with the compilor. Or you could get weird and use uX (microX) which is a tiny GUI lib :)

have fun
Cyb
 
OP
Teamz

Teamz

J'aime tes seins
at it's current status it's nothing more than a 6502 interpreter/debugger :whistling
 

Cyberman

Moderator
Moderator
Oh you are making an NES emulator? ;)
Well I would start with simple 2d graphics support. I like how Borland handled that in Delphi and in BCB. vB is a bit hard for me to figure out using D3D or any graphics with. It seems all canned in that one has trouble doing manipulations.

Sprites might be a bit tricky I believe you might be able too do this using the 2d support. It depends on what the system used as the transparent bits though.

I guess get it working first then worry about the details (hehehe).

Cyb
 
OP
Teamz

Teamz

J'aime tes seins
I'm actually coding this emu with VC6, my VB+D3D question was for my 'job'

I'll use D3D for graphics

I also have some troubles expressing myself in english so that's why we're not getting straight to the point, anyway here's the problem

I don't have a 'skeleton', I'm not sure what to use to represent the 2D graphics

I don't want to think about how i'll manage sprites and stuff yet, I just need some basics info
 

Jsr

New member
The device that generates the graphics in a NES is called PPU (Picture Processing Unit), and thats what you need to emulate.
Go to http://nesdev.parodius.com and get some documents on how it works.

And DirectDraw is enough for displaying the graphics, all you need is something that can display a 256x240 pixels image on the screen.
SDL can be good if you want to port it to other systems.
 
OP
Teamz

Teamz

J'aime tes seins
Jsr said:
The device that generates the graphics in a NES is called PPU (Picture Processing Unit), and thats what you need to emulate.
Go to http://nesdev.parodius.com and get some documents on how it works.

And DirectDraw is enough for displaying the graphics, all you need is something that can display a 256x240 pixels image on the screen.
SDL can be good if you want to port it to other systems.

yeah I know this, I need to know what I'm gonna use from direct3d to represent my data and how i'll manipulate it
 

Cyberman

Moderator
Moderator
I suggest making a D3D buffer to transfer to the display (IE you draw on the buffer display it draw the next frame display it etc.) You will need to know the display mode in use and how the pixels are packed D3D will provide this. Then you write to the buffer raw data.
You need to have two buffers one being drawn on and one being displayed. You copy your virtual display data to one buffer then show it.. and flip flip flip.

As for how to handle it D3D gives you a pointer to the display buffer and you can write directly too it OR you can write to a display context and display that.

Cyb
 
OP
Teamz

Teamz

J'aime tes seins
that's exactly the kind of post I was hoping for :)

I should have explained myself clearer

thx a lot for the answer I'll probably ask for help later ;p
 

PabloJM

New member
SDL is a good start. (www.libsdl.org)
It's very small and supports DX and OGL. By the other hand, you can't draw primitives (squares, circles, etc) with the built-in functionns, and no d3d support yet.
 

Top