Comments (5)
Can you please provide more details about this idea? (or a code sample, if possible)
Currently DataStream class has ~230 usages only in SharpDX.sln, so any changes to it should be implemented with extreme caution.
from sharpdx.
DataStream is a legacy class inherited from SlimDX and mainly used for backward "compatibility", as artiom noted, It is quite heavily referenced. If you want to have random access to a memory buffer you could use DataBuffer. Also, Utilities.Read/Write are often a simpler alternative. It is usually better to avoid using DataStream.
from sharpdx.
An example can help here to explain what I mean:
The font collection loader interface method CreateEnumeratorFromKey
http://msdn.microsoft.com/en-us/library/windows/desktop/dd368216(v=vs.85).aspx
takes in a pointer to the key and size of the key.
The SharpDX version of this method
http://sharpdx.org/documentation/api/m-sharpdx-directwrite-fontcollectionloader-createenumeratorfromkey
uses a DataStream to represent this key
IMHO a DataStream should not be used to refer to pieces of memory like this key argument,
The same can be said for FontFileLoader.CreateStreamFromKey and maybe other methods too.
I guess a SharpDX.DataPointer would be more suitable to marshalling the concept of a "block of memory".
from sharpdx.
Sure, DataPointer was introduced in SharpDX to avoid making DataStream mandatory (DataBuffer and DataStream are automatically castable to DataPointer), so yes, for these methods, I think that's better to make them use DataPointer.
from sharpdx.
Some of the DataStream usages were replaced by DataPointer (in the SharpDX.Direct2D1 assembly).
Feel free to post here if there are some specific usages that need to be refactored.
from sharpdx.
Related Issues (20)
- Unable to create instances on Windows 7 (up to date)
- Function mapping guideline question HOT 2
- Missing trigger detection on Nyko Playpad Pro
- how can i create SharpDX.Direct2D1.Factory4? HOT 2
- Add DXCompiler HOT 5
- Disable MSDN Documentation Provider HOT 1
- Unity IL2Cpp throw System.NotImplementedException HOT 2
- How to add customized ViewCube?
- CallbackBase.Release() - Null reference exception
- .NET Core Support
- AudioProcessorBase.LockForProcess method is not virtual
- DirectInput.GetDevices(DeviceType deviceType, DeviceEnumerationFlags deviceEnumFlags) takes very long time
- texture size is reported wrong HOT 3
- Question about returning unsigned long in Interfaces.cs
- One cannot pass NULL to MapSubresource for the parameter D3D11_MAPPED_SUBRESOURCE *pMappedResource HOT 2
- Bug in Mapping.xml file? HOT 1
- Question about memory
- Error in 4.2 version that not was in 4.0.1 version
- Matrix3x2.ScaleVector calculation is incorrect for rotated transforms
- New Managed DirectX bindings HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpdx.