• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About jast112

  • Rank
  1. OpenGL Get Context

    Quote:Original post by BionicBytes It would seem that you do not have a valid glViewPort() values. ... which may imply an invalid context. Can you be sure that when you call this method you really do have a valid gl context? 1st Thanks for the replay. So how to check that its valid or not?
  2. OpenGL Get Context

    Omg tnx ill see and give it a try. Okay tested it and im getting Index was outside the bounds of the array Exeption on line System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(video_width, video_height, stride, pixelFormat, (IntPtr)buffer[0]); //made some changes here I looked thoruh with steps and video_width = video[2]; video_height = video[3]; size = 3 * video_width * video_height; // both video width and height are 0 why is that ... [Edited by - jast112 on April 22, 2008 9:51:34 AM]
  3. OpenGL Get Context

    Quote:Original post by LordOrion Hi, I'm not an expert of C# and how it is interfaced with OpenGL, so I cannot help you with the context... but seeing your code I've noticed that you are trying to read pixels from the Back Buffer: GL.glReadBuffer(GL.GL_BACK); Try read the front Buffer instead. Back buffer is often cleared immediately after the swap or immediately before begin a new frame so you cannot rely on its content. I hope this can help Thanks for your help but GL_FRONT Same Black Screen. But im buidling it in C# but C++ ways help allsow.
  4. Hey. I have injected dll to 3rd party opengl app. And now i need to get context of the app window.How can i get the context ?? Main goal is to take the screenshot. Im trying to take like fraps does in C#. This code i used to get but some how the screenshot is black. This is the only opengl function in dll. [CODE] Bitmap b = new Bitmap(s.Width, s.Height, PixelFormat.Format32bppRgb); BitmapData bd = b.LockBits(new Rectangle(0, 0, s.Width, s.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb); GL.glReadBuffer(GL.GL_BACK); GL.glReadPixels(0, 0, s.Width,s.Height, GL.GL_RGB, GL.GL_UNSIGNED_BYTE,bd.Scan0); //b.RotateFlip(); b.Save(@"D:\screen67023.Jpeg", ImageFormat.Jpeg); b.UnlockBits(bd); [/CODE] What Am i missing? Any help is good. Regards, KJ.
  5. OpenGL Opengl C#

    Why are my screenshots black am i missing something???
  6. OpenGL directx screenshots

    Thanks Gage64 Your very helpful.
  7. OpenGL directx screenshots

    Thanks for your quick answers. But can u point me a direction where can i see informtion about C# opengl. Opengl im pretty dum :D
  8. Hey all. Anyone can tell me why are my screenshots black???? plz help ty Im using CsGl Here is the code. [CODE] Size s = Size; Bitmap b = new Bitmap(s.Width, s.Height, PixelFormat.Format32bppArgb); BitmapData bd = b.LockBits(new Rectangle(0, 0, s.Width, s.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); GL.glReadPixels(0, 0, 1600, 1200, GL.GL_BGRA_EXT, GL.GL_UNSIGNED_BYTE, bd.Scan0); b.UnlockBits(bd); //b.RotateFlip(); b.Save(@"D:\screen.bmp", ImageFormat.Bmp); [/CODE] Regards, fadah. [Edited by - jast112 on April 16, 2008 11:40:33 AM]
  9. OpenGL directx screenshots

    so u should take the screenshots with opengl or what?
  10. Hello. I have problem when my game is in opengl mode it takes black screenshots what should be the problem? Here is the screenshot code. [CODE] PresentParameters PresentParams = new PresentParameters(); PresentParams.Windowed = true; PresentParams.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Discard; DXDevice = new Microsoft.DirectX.Direct3D.Device(0,DeviceType.Hardware, this,CreateFlags.SoftwareVertexProcessing, PresentParams); Surface buff = DXDevice.CreateOffscreenPlainSurface(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.SystemMemory); DXDevice.GetFrontBufferData(0, buff); SurfaceLoader.Save(@"D:\test.bmp", ImageFileFormat.Bmp, buff); [/CODE]
  11. Hello again. I was finding out that the best way to do a screenshot on vista is to hook the dll file with a 3rd party app. So my question is How do u hook a win api screenshot code to a 3rd party app? All suggestion, links, source codes are welcome. Regards, fadah
  12. Capture Screenshot C#

    Okay. Problem was vistas window manager.I stoped it and now im just getting black screenshot with shift - printscreen. Anyone could help me out?
  13. Capture Screenshot C#

    shift printscreen takes the screenshot of a games background what is in loading mode :D.
  14. Capture Screenshot C#

    Quote:Original post by TheTroll This is my suggestion; *** Source Snippet Removed *** Hope that helps you out. theTroll Whit Your Code same result only form desktop but still the counter strike box in top left. Im using GDI32 and user32 Apis. Its like when the shot is taken the app it makes the alt tab effect :) I see same restult for a sec when i press alt tab. I really cant figure it out.Maby someone has a working screenshot code for vista in C#.
  15. Hello ALL. Im trying to take Screenshot of an opengl game on vista but i get black screen. Here is what it makes i added timer and GDI GetForgroundWindow(); to make handle, and the picture ends up with http://img267.imageshack.us/my.php?image=temp2323no7.gif Look at the uper left corner where the game window goes It should be Fullscreen on pic but its not.When the image is taken my game window is fullscreen all the time but on picture like this.What would be the reason? When i set my game window to d3d it works create no problems... So the problem is with opengl ( my os is vista premium ); Problem is only with vista on xp works fine with opengl mode... What should i do My vista is running directX 10 Plz help. Sry about my english. Thank you!