473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

XNA and speeds...

GaryTexmo
1,501 Expert 1GB
I'm curious about XNA and drawing speeds... I'm finding I'm not getting what I would have expected. First, a little background on me. I started programming in QuickBasic and really liked the graphics library that came with it because it was very easy to work with. After rewriting the primitive functions in assembly, I found you could get very good speeds out of it... to the point where you could draw several 64000 pixel buffers to the screen, and all the calculations that go with it, still getting frame rates of 75 and up (on older hardware no less).

Now, I've been using XNA lately and am really liking it. It's very easy to use and reasonably straightforward, at least for the 2D stuff. Since there's no built-in 2D primitive library, I've made my own. The code for it is here:

http://members.shaw.ca/gtexmo/Code/X...D/Primative.cs
(I realize I spelled "Primitive" wrong... Oops!)

With this I can only put out about 23000 lines/points before I start to dip below my refresh rate's fps cap (75... vsync on). I figured that maybe sprite stamping wasn't the most efficient way to draw lines, so I figured I'd try using line primatives (as found at the following article). However, when I implemented this, I was finding I was getting roughly half the FPS of the sprite stamping method.

In all cases, the test I had with my draw method in my game class was:

Expand|Select|Wrap|Line Numbers
  1. for (int i = 0; i < 23000; i++)
  2. {
  3.   Primative.Line(<random vector>, <random vector>, 1, Color.White);
  4. }
Is it just me or does this seem very strange? I would have thought XNA could push out more than 23000 lines without slowing down in the slightest.
Sep 2 '09 #1
3 2266
cloud255
427 Expert 256MB
Well too be honest I'm not too surprised, from what I understand MS tends to exaggerate a bit when it comes to the power of XNA (never used it personally). Have you considered using OpenGL?
Sep 3 '09 #2
GaryTexmo
1,501 Expert 1GB
Yea, I've used OpenGL before but it's not nearly as nice to work with. In addition, OpenGL has given absolutely no consideration to 2D. I tried a long time ago making a 2D library that operated in a texture buffer and slapped it to a poly that took up the whole screen. It worked well enough, I suppose, but the obvious flaw is that the CPU is doing damn near everything.

I've thought about DirectX, but to be honest I just want something quick and easy, like QuickBasic used to be! :D Ahhh, I guess the times, they are a changin', so to speak.

Again though, don't get me wrong, XNA is fantastic, I just somehow thought it would be faster... I figured on my doing something wrong.
Sep 3 '09 #3
cloud255
427 Expert 256MB
Well you could always go and write your own optimized libraries in C++ and assembler :) Should be a fun experiment (time consuming) but then you will forever have libraries that you know perform well...
Sep 3 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tom O'Neill | last post by:
------=_NextPart_000_055D_01C3672C.FBA9D860 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is there any difference in speed between the following...
1
by: Paul | last post by:
Hello, I know mysql update queries can only utilize one index, making them slow in some cases. My update are taking about 3 hours, joining 2 tables on their primary keys. (table sizes about 1...
1
by: Ralph Noble | last post by:
I have two avenues to access my primary SQL Server. (I work remotely using a VPN connection.) Usually, I hit the server from my local machine but I also login to a desktop machine inside the...
1
by: Serdar C. | last post by:
i am trying to write a program to control upload and download speeds over specific ports like i have 128kbit download and 64kbit upload speed total.. i want to let port xxxx to use maximum amount...
0
by: Brian Henry | last post by:
is there a way to get the current speed that a network interface is sending and recieveing data at that moment in VB.net? thanks
0
by: Chaos | last post by:
For the Program I Am Making I Make Multiple HTTP Request to My Server. I found that using urllib2 it was pretty slow, when I activated the program and tested it it would hang from 2secs-5secs since...
4
by: mpaine | last post by:
I just converted lots of ASP to ASP.NET (using ASP2ASPX) and noticed a drop in rendering speed. For example, one ASP page takes 0.0313s to be generated while the ASP.NET version takes 0.4842s. ...
3
by: sbowman | last post by:
I have a database that I was using for Monthly Statistics. I've recently loaded hundreds of thousands of records of historical data. Now my queries are running really slow!! Is there anything I can...
3
natalie99
by: natalie99 | last post by:
Hello I need a very simple question answered if anyone could please help :) After moving office locations, our shared network connection (attached to old building where employees still use the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.