Search Results

Search found 2 results on 1 pages for 'aidiakapi'.

Page 1/1 | 1 

  • Information about rendering, batches, the graphical card, performance etc. + XNA?

    - by Aidiakapi
    I know the title is a bit vague but it's hard to describe what I'm really looking for, but here goes. When it comes to CPU rendering, performance is mostly easy to estimate and straightforward, but when it comes to the GPU due to my lack of technical background information, I'm clueless. I'm using XNA so it'd be nice if theory could be related to that. So what I actually wanna know is, what happens when and where (CPU/GPU) when you do specific draw actions? What is a batch? What influence do effects, projections etc have? Is data persisted on the graphics card or is it transferred over every step? When there's talk about bandwidth, are you talking about a graphics card internal bandwidth, or the pipeline from CPU to GPU? Note: I'm not actually looking for information on how the drawing process happens, that's the GPU's business, I'm interested on all the overhead that precedes that. I'd like to understand what's going on when I do action X, to adapt my architectures and practices to that. Any articles (possibly with code examples), information, links, tutorials that give more insight in how to write better games are very much appreciated. Thanks :)

    Read the article

  • What is the fastest (possibly unsafe) way to read a byte[]?

    - by Aidiakapi
    I'm working on a server project in C#, and after a TCP message is received, it is parsed, and stored in a byte[] of exact size. (Not a buffer of fixed length, but a byte[] of an absolute length in which all data is stored.) Now for reading this byte[] I'll be creating some wrapper functions (also for compatibility), these are the signatures of all functions I need: public byte ReadByte(); public sbyte ReadSByte(); public short ReadShort(); public ushort ReadUShort(); public int ReadInt(); public uint ReadUInt(); public float ReadFloat(); public double ReadDouble(); public string ReadChars(int length); public string ReadString(); The string is a \0 terminated string, and is probably encoded in ASCII or UTF-8, but I cannot tell that for sure, since I'm not writing the client. The data exists of: byte[] _data; int _offset; Now I can write all those functions manually, like this: public byte ReadByte() { return _data[_offset++]; } public sbyte ReadSByte() { byte r = _data[_offset++]; if (r >= 128) return (sbyte)(r - 256); else return (sbyte)r; } public short ReadShort() { byte b1 = _data[_offset++]; byte b2 = _data[_offset++]; if (b1 >= 128) return (short)(b1 * 256 + b2 - 65536); else return (short)(b1 * 256 + b2); } public short ReadUShort() { byte b1 = _data[_offset++]; return (short)(b1 * 256 + _data[_offset++]); } But I wonder if there's a faster way, not excluding the use of unsafe code, since this seems a little bit too much work for simple processing.

    Read the article

1