![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Best way to draw a game's view... Hey everyone, I used to be a programmer for the tapwave zodiac (it's a pda), and my game would draw to the screen with functions that acted similar to GDI+. You know, things like WinPaintLine corresponding to DrawLine, etc. Anyway, the way my game works is it has a two-dimensional array of "icons", basically a class containing a character and the color it appears as (its a roguelike game, so colored characters are the medium), and when I want to draw the map to the screen I would cycle through, set the color to draw in, and then draw the character. However, the size of the viewable map area (how many rows and columns could fit on the screen) was variable. So that presents a problem... My question is basically, what's the best way to do this? I'm thinking making a bitmap somehow and then just putting that onto the screen would be good enough, but that doesnt agree with Avalon's whole vector-based display idea. I also am reluctant to make every character into its own TextBlock because that would have a lot of space taken up, and probably be very slow, and I wouldn't be able to draw my effects on them. And I couldn't make one big TextBlock with a font with same-size letters, because that also wouldn't let me do my effects between them. What I need is GDI+ here. But GDI+ doesn't seem to exist in WPF. I need that raw power and control that it gives me, without using cheap workarounds like making them all into separate controls, etc. What is the best way to pull this off? Thanks for your time and your patience ![]() - E |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Best way to draw a game's view... You might want to give WPF a chance before looking for a way to use GDI+. From my experience so far with WPF, it is very performant already, and keeps getting better. When I first saw how large the visual tree could be for a relatively simple UI, I had similar concerns similar to what you expressed. I must say, though, that MS has done a stellar job with keeping the rendering fast. I'd say try making a prototype of your game "the WPF way" and see if it meets your performance needs. Use seperate TextBlocks, go wild. If itdoesn't meet your needs, the WPF Performance Team might be willing to analyze your app to find the bottleneck (I've seen them do it with other people's apps on this board). Josh "Verdagon@gmail.com" wrote: > Hey everyone, > > I used to be a programmer for the tapwave zodiac (it's a pda), and my > game would draw to the screen with functions that acted similar to > GDI+. You know, things like WinPaintLine corresponding to DrawLine, > etc. > > Anyway, the way my game works is it has a two-dimensional array of > "icons", basically a class containing a character and the color it > appears as (its a roguelike game, so colored characters are the > medium), and when I want to draw the map to the screen I would cycle > through, set the color to draw in, and then draw the character. > > However, the size of the viewable map area (how many rows and columns > could fit on the screen) was variable. So that presents a problem... > > My question is basically, what's the best way to do this? > > I'm thinking making a bitmap somehow and then just putting that onto > the screen would be good enough, but that doesnt agree with Avalon's > whole vector-based display idea. I also am reluctant to make every > character into its own TextBlock because that would have a lot of space > taken up, and probably be very slow, and I wouldn't be able to draw my > effects on them. And I couldn't make one big TextBlock with a font with > same-size letters, because that also wouldn't let me do my effects > between them. > > What I need is GDI+ here. But GDI+ doesn't seem to exist in WPF. I need > that raw power and control that it gives me, without using cheap > workarounds like making them all into separate controls, etc. What is > the best way to pull this off? > > Thanks for your time and your patience ![]() > > - E > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Best way to draw a game's view... In general, for those of you that want to do low level graphics programming (but higher level than Direct3D), I would recommend using the Visual layer, instead of the framework (Shapes, TextBlock, etc). This is not something that I recommend for everyone, just folks that are not focused on UI or documents, and want to do more of the scene management (layout for example) themselves. http://www.fernicola.org/loquitor/in...straction.html -Pablo "Josh Smith" <JoshSmith@discussions.microsoft.com> wrote in message news:B1CBE379-1A59-4BC3-AEDD-5F5518FBFFEB@microsoft.com... > You might want to give WPF a chance before looking for a way to use GDI+. > From my experience so far with WPF, it is very performant already, and > keeps > getting better. When I first saw how large the visual tree could be for a > relatively simple UI, I had similar concerns similar to what you > expressed. > I must say, though, that MS has done a stellar job with keeping the > rendering > fast. > > I'd say try making a prototype of your game "the WPF way" and see if it > meets your performance needs. Use seperate TextBlocks, go wild. If it> doesn't meet your needs, the WPF Performance Team might be willing to > analyze > your app to find the bottleneck (I've seen them do it with other people's > apps on this board). > > Josh > > "Verdagon@gmail.com" wrote: > >> Hey everyone, >> >> I used to be a programmer for the tapwave zodiac (it's a pda), and my >> game would draw to the screen with functions that acted similar to >> GDI+. You know, things like WinPaintLine corresponding to DrawLine, >> etc. >> >> Anyway, the way my game works is it has a two-dimensional array of >> "icons", basically a class containing a character and the color it >> appears as (its a roguelike game, so colored characters are the >> medium), and when I want to draw the map to the screen I would cycle >> through, set the color to draw in, and then draw the character. >> >> However, the size of the viewable map area (how many rows and columns >> could fit on the screen) was variable. So that presents a problem... >> >> My question is basically, what's the best way to do this? >> >> I'm thinking making a bitmap somehow and then just putting that onto >> the screen would be good enough, but that doesnt agree with Avalon's >> whole vector-based display idea. I also am reluctant to make every >> character into its own TextBlock because that would have a lot of space >> taken up, and probably be very slow, and I wouldn't be able to draw my >> effects on them. And I couldn't make one big TextBlock with a font with >> same-size letters, because that also wouldn't let me do my effects >> between them. >> >> What I need is GDI+ here. But GDI+ doesn't seem to exist in WPF. I need >> that raw power and control that it gives me, without using cheap >> workarounds like making them all into separate controls, etc. What is >> the best way to pull this off? >> >> Thanks for your time and your patience ![]() >> >> - E >> >> |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Corel draw x13 | Software | |||
| Draw Pad Issues | Windows Live | |||
| How and where can I install direct draw from? | Vista General | |||