Jump to content

  • Log In with Google      Sign In   
  • Create Account

spazzarama

Member Since 19 Mar 2014
Offline Last Active Today, 06:19 PM

Posts I've Made

In Topic: Recommeneded books for directx (C#)

28 February 2016 - 02:16 AM

Hi Nitewalkr, I wrote a book a couple of years ago around Direct3D 11 and C# using SharpDX - Direct3D Rendering Cookbook, you can also find a heap of SharpDX tutorials that have been translated from the C++ rastertek tutes (somewhere on this forum from memory).


In Topic: take screenshot on secondary screen

11 November 2015 - 03:54 AM


Just want to know if it is possible to take a screenshot from my second monitor.

 

Yes it is possible, however it will depend what is on there as to the approach. If you want to capture the second screen regardless of what is shown there, then you might need to look down the road of mirror drivers and the like (or more traditional desktop capture approaches). If a fullscreen Direct3D window is being shown on the 2nd display then you might need to look at grabbing the image from Direct3D.

 

If the 2nd screen is showing the desktop, I don't think using the DirectX approach isn't going to work unless you are working with the DWM.

 

You may need to implement more than one approach to handle all the scenarios, but again we don't know what you are trying to do exactly.

 

Just a tip - capturing from the front buffer is always going to be slow, and capturing from the backbuffer from 3rd party apps is usually done through hooking (take a look at the Direct3DHook project in my signature).

 

Other approaches include a mirror display driver but I don't have much experience with these.


In Topic: Visual Studio C#, Best way to implement many "GUI Panels"

11 November 2015 - 03:46 AM

I know you are currently using WinForms, however I would highly recommend trying out XAML (i.e. using WPF) - at least so you can see the difference between the two approaches. WPF is designed for dealing with this sort of layout stuff, you can bind the visibility of panels to properties on your view model, you can even implement animation transitions completely within XAML (i.e. slide in/out with almost zero coding). It has a steep learning curve but is really flexible and powerful - it might also be worth taking a look at some MVVM tutorials for WPF but this might be a bit advanced for right at the moment.

 

Good luck!


In Topic: Using whitelisting to run untrusted C# code safely

06 October 2015 - 12:28 AM

Could you please elaborate on what you are trying to protect, your application, or your user's system?

 

I would probably read that caution as "don't rely solely on CAS".

 

You can provide a handler for the AppDomain resolve assembly name / type, and prevent particular types/assemblies from being accessed in your AppDomain. This might also help you prevent reflection from bypassing a whitelisting implementation (e.g. restrict access to the reflection types).

 

Btw, reflection can let you mess with non-public members as well, so don't ignore that.

 

Maybe all this combined with a "peer review/approved" approach to marking safe maps/plugins would be enough - then the user can be warned about the dangers of using a particular extension.

 

Add-ins might also be of interest: https://msdn.microsoft.com/en-us/library/bb384200.aspx and https://msdn.microsoft.com/en-us/library/bb355219.aspx


In Topic: Direct3D11 Multithreading

21 September 2015 - 01:50 AM

As @MJP said you are unlikely to gain much performance using deferred contexts with D3D11 *unless* you are doing a lot of CPU intensive work that for whatever reason you cannot separate from your rendering logic *and* can actually be parallelised.

 

I've got a C#/SharpDX example https://github.com/spazzarama/Direct3D-Rendering-Cookbook/tree/master/Ch10_01DeferredRendering. You may need to take a good look at the code to work out how to drive it as it is assumed you are reading the book at the same time.


PARTNERS