Jump to content
  • Advertisement

FatSimon

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

126 Neutral

About FatSimon

  • Rank
    Newbie
  1. This (or something like it) should work: using(Surface surface=device.GetBackBuffer(0, 0, BackBufferType.Mono)) { using(Stream stream=SurfaceLoader.SaveToStream(ImageFileFormat.Bmp, surface)) { Bitmap bitmap=new Bitmap(stream); } }
  2. Just a stab in the dark here: If TerrainPanel.Width and TerrainPanel.Height are integers, then when you divide them in the perspective matrix call, they are divided as integers. So, if the height is greater than the width, the result will be 0, which probably screws up the matrix enough to make it not work. Try this instead: (float)TerrainPanel.Width / (float)TerrainPanel.Height
  3. Okay, do it like this then: public interface TheInterface<T> where T : class { void SomeMethod<S>(T t, S a) where S : T; }
  4. This code compiles and runs fine for me, perhaps you didn't remove the "class" constraint from MyClass after you removed it from TheInterface<T>? class Program { static void Main(string[] args) { new MyClass().SomeMethod(new Data(), new A()); } } public interface TheInterface<T> { void SomeMethod<S>(T t, S a) where S : T; } public class Data { } public class A : Data { } public class MyClass : TheInterface<Data> { public void SomeMethod<S>(Data t, S a) where S : Data { Console.WriteLine(a.GetType()); } }
  5. FatSimon

    Maximum distance in a set of points

    'h' is the number of points that end up on the convex hull.
  6. That should work, but the following would be even better: if((n & 1<<j)!=0)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!