ToString() public method

public ToString ( ) : String
return String
Example #1
2
		public static void GetHistogramEXT(HistogramTargetEXT target, bool reset, PixelFormat format, PixelType type, IntPtr values)
		{
			Debug.Assert(Delegates.pglGetHistogramEXT != null, "pglGetHistogramEXT not implemented");
			Delegates.pglGetHistogramEXT((Int32)target, reset, (Int32)format, (Int32)type, values);
			CallLog("glGetHistogramEXT({0}, {1}, {2}, {3}, 0x{4})", target, reset, format, type, values.ToString("X8"));
			DebugCheckErrors();
		}
		public static void SetBlobCacheFuncsANDROID(IntPtr dpy, SetBlobFuncDelegate set, GetBlobFuncDelegate get)
		{
			Debug.Assert(Delegates.peglSetBlobCacheFuncsANDROID != null, "peglSetBlobCacheFuncsANDROID not implemented");
			Delegates.peglSetBlobCacheFuncsANDROID(dpy, set, get);
			LogFunction("eglSetBlobCacheFuncsANDROID(0x{0}, {1}, {2})", dpy.ToString("X8"), set, get);
			DebugCheckErrors(null);
		}
        public static Bitmap Create(IntPtr hDesk)
        {
            Bitmap bmp = null;

            if (!string.IsNullOrEmpty(hDesk.ToString()))
            {
                // Get window info: size, x, y
                WINDOWINFO info = new WINDOWINFO();
                info.cbSize = (uint)Marshal.SizeOf(info);
                NativeWin32.GetWindowInfo(hDesk, ref info);
                Rectangle rect = new Rectangle((int)info.rcWindow.Left, (int)info.rcWindow.Top, Math.Abs((int)info.rcWindow.Left - (int)info.rcWindow.Right), Math.Abs((int)info.rcWindow.Top - (int)info.rcWindow.Bottom));

                // Set pointers
                IntPtr hSrce = NativeWin32.GetWindowDC(hDesk);
                IntPtr hDest = NativeWin32.CreateCompatibleDC(hSrce);
                IntPtr hBmp = NativeWin32.CreateCompatibleBitmap(hSrce, rect.Width, rect.Height);
                IntPtr hOldBmp = NativeWin32.SelectObject(hDest, hBmp);

                //  Create bitmap
                bmp = new Bitmap(rect.Width, rect.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
                Graphics gfxScreenShot = Graphics.FromImage(bmp);
                gfxScreenShot.CopyFromScreen(rect.X, rect.Y, 0, 0, rect.Size, CopyPixelOperation.SourceCopy);

            }
            else
            {
                // logging
            }

            return bmp;
        }
Example #4
0
 public static MyType CreateWrapper(IntPtr ptr)
 {
     Console.WriteLine();
     Console.WriteLine(ptr.ToString());
     Console.WriteLine();
     return new MyType { intPtr = ptr };
 }
		public static void StringMarkerGREMEDY(Int32 len, IntPtr @string)
		{
			Debug.Assert(Delegates.pglStringMarkerGREMEDY != null, "pglStringMarkerGREMEDY not implemented");
			Delegates.pglStringMarkerGREMEDY(len, @string);
			CallLog("glStringMarkerGREMEDY({0}, 0x{1})", len, @string.ToString("X8"));
			DebugCheckErrors();
		}
Example #6
0
 public static void TraceRef(IntPtr pUnk, string msg) {
     GC.Collect(); // collect any outstanding RCW or CCW's.
     if (pUnk == IntPtr.Zero) return;
     Marshal.AddRef(pUnk);
     int count = Marshal.Release(pUnk);
     Trace.WriteLine(msg + ": 0x" + pUnk.ToString("x") + "(ref=" + count + ")");
 }
		public static void MultiDrawArraysIndirectBindNV(Int32 mode, IntPtr indirect, Int32 drawCount, Int32 maxDrawCount, Int32 stride, Int32 vertexBufferCount)
		{
			Debug.Assert(Delegates.pglMultiDrawArraysIndirectBindlessCountNV != null, "pglMultiDrawArraysIndirectBindlessCountNV not implemented");
			Delegates.pglMultiDrawArraysIndirectBindlessCountNV(mode, indirect, drawCount, maxDrawCount, stride, vertexBufferCount);
			CallLog("glMultiDrawArraysIndirectBindlessCountNV({0}, 0x{1}, {2}, {3}, {4}, {5})", mode, indirect.ToString("X8"), drawCount, maxDrawCount, stride, vertexBufferCount);
			DebugCheckErrors();
		}
		public static void VertexArrayRangeAPPLE(Int32 length, IntPtr pointer)
		{
			Debug.Assert(Delegates.pglVertexArrayRangeAPPLE != null, "pglVertexArrayRangeAPPLE not implemented");
			Delegates.pglVertexArrayRangeAPPLE(length, pointer);
			CallLog("glVertexArrayRangeAPPLE({0}, 0x{1})", length, pointer.ToString("X8"));
			DebugCheckErrors();
		}
		public static void ClearDepthOES(IntPtr depth)
		{
			Debug.Assert(Delegates.pglClearDepthxOES != null, "pglClearDepthxOES not implemented");
			Delegates.pglClearDepthxOES(depth);
			LogFunction("glClearDepthxOES(0x{0})", depth.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void ClearColorOES(IntPtr red, IntPtr green, IntPtr blue, IntPtr alpha)
		{
			Debug.Assert(Delegates.pglClearColorxOES != null, "pglClearColorxOES not implemented");
			Delegates.pglClearColorxOES(red, green, blue, alpha);
			LogFunction("glClearColorxOES(0x{0}, 0x{1}, 0x{2}, 0x{3})", red.ToString("X8"), green.ToString("X8"), blue.ToString("X8"), alpha.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void AlphaFuncOES(Int32 func, IntPtr @ref)
		{
			Debug.Assert(Delegates.pglAlphaFuncxOES != null, "pglAlphaFuncxOES not implemented");
			Delegates.pglAlphaFuncxOES(func, @ref);
			LogFunction("glAlphaFuncxOES({0}, 0x{1})", LogEnumName(func), @ref.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void ElementPointerATI(Int32 type, IntPtr pointer)
		{
			Debug.Assert(Delegates.pglElementPointerATI != null, "pglElementPointerATI not implemented");
			Delegates.pglElementPointerATI(type, pointer);
			CallLog("glElementPointerATI({0}, 0x{1})", type, pointer.ToString("X8"));
			DebugCheckErrors();
		}
Example #13
0
		public static void AlphaFuncOES(Int32 func, IntPtr @ref)
		{
			Debug.Assert(Delegates.pglAlphaFuncxOES != null, "pglAlphaFuncxOES not implemented");
			Delegates.pglAlphaFuncxOES(func, @ref);
			CallLog("glAlphaFuncxOES({0}, 0x{1})", func, @ref.ToString("X8"));
			DebugCheckErrors();
		}
		public static void BindBufferOffsetEXT(Int32 target, UInt32 index, UInt32 buffer, IntPtr offset)
		{
			Debug.Assert(Delegates.pglBindBufferOffsetEXT != null, "pglBindBufferOffsetEXT not implemented");
			Delegates.pglBindBufferOffsetEXT(target, index, buffer, offset);
			LogFunction("glBindBufferOffsetEXT({0}, {1}, {2}, 0x{3})", LogEnumName(target), index, buffer, offset.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void VertexArrayRangeNV(Int32 length, IntPtr pointer)
		{
			Debug.Assert(Delegates.pglVertexArrayRangeNV != null, "pglVertexArrayRangeNV not implemented");
			Delegates.pglVertexArrayRangeNV(length, pointer);
			LogFunction("glVertexArrayRangeNV({0}, 0x{1})", length, pointer.ToString("X8"));
			DebugCheckErrors(null);
		}
        private void button1_Click(object sender, EventArgs e)
        {
            Process[] Ps = Process.GetProcessesByName(tbProcess.Text);
            if (Ps.Count<Process>() == 0)
                return;
            baseaddress = Ps[0].MainModule.BaseAddress;
            tbBase.Text = baseaddress.ToString("X");
            int address = int.Parse(tbAddress.Text, System.Globalization.NumberStyles.HexNumber);
            int length = int.Parse(tbLength.Text, System.Globalization.NumberStyles.HexNumber);
            if (length == 0)
                return;
            IntPtr readaddress;
            if (cbRelative.Checked)
                readaddress = baseaddress + address;
            else
                readaddress = (IntPtr)address;

            processHandle = OpenProcess(0x0010, false, Ps[0].Id);
            if (processHandle == IntPtr.Zero)
                return;

            rbuff = new byte[length];
            int rn = 0;
            bool ret = ReadProcessMemory(processHandle, readaddress, rbuff, length, ref rn);
            if (ret)
            {
                FileStream fs = new FileStream("mem.bin", FileMode.Create);
                fs.Write(rbuff, 0, length);
                fs.Close();
            }
            else
            {
                MessageBox.Show("Failed");
            }
        }
		public static void VDPAUInitNV(IntPtr vdpDevice, IntPtr getProcAddress)
		{
			Debug.Assert(Delegates.pglVDPAUInitNV != null, "pglVDPAUInitNV not implemented");
			Delegates.pglVDPAUInitNV(vdpDevice, getProcAddress);
			CallLog("glVDPAUInitNV(0x{0}, 0x{1})", vdpDevice.ToString("X8"), getProcAddress.ToString("X8"));
			DebugCheckErrors();
		}
		public static void BufferPageCommitmentARB(Int32 target, IntPtr offset, UInt32 size, bool commit)
		{
			Debug.Assert(Delegates.pglBufferPageCommitmentARB != null, "pglBufferPageCommitmentARB not implemented");
			Delegates.pglBufferPageCommitmentARB(target, offset, size, commit);
			LogFunction("glBufferPageCommitmentARB({0}, 0x{1}, {2}, {3})", LogEnumName(target), offset.ToString("X8"), size, commit);
			DebugCheckErrors(null);
		}
        private bool Result(IntPtr hwnd, IntPtr lParam)
        {
            List<IntPtr> results = GetChildWindows(hwnd);

            allWndHandle.Add(results);
            StringBuilder strbuild = new StringBuilder(256);
            Win32.GetWindowText(hwnd, strbuild, 256);
            allScndWndHandle.Add(hwnd.ToString() + " " + strbuild.ToString());
                        
            if (results.Find(
                delegate(IntPtr wnd)
                {
                    if (wnd == m_window)
                        return true;
                    else
                        return false;
                }) != IntPtr.Zero || hwnd == m_window)
            {
                StringBuilder mainWin = new StringBuilder(256);
                StringBuilder scndWin = new StringBuilder(256);
                Win32.GetWindowText(hwnd, mainWin, 256);
                Win32.GetWindowText(m_window, scndWin, 256);
                m_mainWindow = hwnd;
            }
            return true;
        }
		public static void ElementPointerAPPLE(Int32 type, IntPtr pointer)
		{
			Debug.Assert(Delegates.pglElementPointerAPPLE != null, "pglElementPointerAPPLE not implemented");
			Delegates.pglElementPointerAPPLE(type, pointer);
			LogFunction("glElementPointerAPPLE({0}, 0x{1})", LogEnumName(type), pointer.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void PixelDataRangeNV(Int32 target, Int32 length, IntPtr pointer)
		{
			Debug.Assert(Delegates.pglPixelDataRangeNV != null, "pglPixelDataRangeNV not implemented");
			Delegates.pglPixelDataRangeNV(target, length, pointer);
			LogFunction("glPixelDataRangeNV({0}, {1}, 0x{2})", LogEnumName(target), length, pointer.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void MultiDrawArraysIndirectARB(Int32 mode, IntPtr indirect, IntPtr drawcount, Int32 maxdrawcount, Int32 stride)
		{
			Debug.Assert(Delegates.pglMultiDrawArraysIndirectCountARB != null, "pglMultiDrawArraysIndirectCountARB not implemented");
			Delegates.pglMultiDrawArraysIndirectCountARB(mode, indirect, drawcount, maxdrawcount, stride);
			LogFunction("glMultiDrawArraysIndirectCountARB({0}, 0x{1}, 0x{2}, {3}, {4})", LogEnumName(mode), indirect.ToString("X8"), drawcount.ToString("X8"), maxdrawcount, stride);
			DebugCheckErrors(null);
		}
		public static void TextureRangeAPPLE(Int32 target, Int32 length, IntPtr pointer)
		{
			Debug.Assert(Delegates.pglTextureRangeAPPLE != null, "pglTextureRangeAPPLE not implemented");
			Delegates.pglTextureRangeAPPLE(target, length, pointer);
			LogFunction("glTextureRangeAPPLE({0}, {1}, 0x{2})", LogEnumName(target), length, pointer.ToString("X8"));
			DebugCheckErrors(null);
		}
Example #24
0
		public static void GetColorTableSGI(ColorTableTargetSGI target, PixelFormat format, PixelType type, IntPtr table)
		{
			Debug.Assert(Delegates.pglGetColorTableSGI != null, "pglGetColorTableSGI not implemented");
			Delegates.pglGetColorTableSGI((Int32)target, (Int32)format, (Int32)type, table);
			CallLog("glGetColorTableSGI({0}, {1}, {2}, 0x{3})", target, format, type, table.ToString("X8"));
			DebugCheckErrors();
		}
Example #25
0
		public static void GetConvolutionFilterEXT(ConvolutionTargetEXT target, PixelFormat format, PixelType type, IntPtr image)
		{
			Debug.Assert(Delegates.pglGetConvolutionFilterEXT != null, "pglGetConvolutionFilterEXT not implemented");
			Delegates.pglGetConvolutionFilterEXT((Int32)target, (Int32)format, (Int32)type, image);
			CallLog("glGetConvolutionFilterEXT({0}, {1}, {2}, 0x{3})", target, format, type, image.ToString("X8"));
			DebugCheckErrors();
		}
		public static void IglooInterfaceSGIX(Int32 pname, IntPtr @params)
		{
			Debug.Assert(Delegates.pglIglooInterfaceSGIX != null, "pglIglooInterfaceSGIX not implemented");
			Delegates.pglIglooInterfaceSGIX(pname, @params);
			LogFunction("glIglooInterfaceSGIX({0}, 0x{1})", LogEnumName(pname), @params.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void GetnTexImageARB(Int32 target, Int32 level, Int32 format, Int32 type, Int32 bufSize, IntPtr img)
		{
			Debug.Assert(Delegates.pglGetnTexImageARB != null, "pglGetnTexImageARB not implemented");
			Delegates.pglGetnTexImageARB(target, level, format, type, bufSize, img);
			LogFunction("glGetnTexImageARB({0}, {1}, {2}, {3}, {4}, 0x{5})", LogEnumName(target), level, LogEnumName(format), LogEnumName(type), bufSize, img.ToString("X8"));
			DebugCheckErrors(null);
		}
		public static void MultiDrawArraysIndirectBindNV(Int32 mode, IntPtr indirect, Int32 drawCount, Int32 stride, Int32 vertexBufferCount)
		{
			Debug.Assert(Delegates.pglMultiDrawArraysIndirectBindlessNV != null, "pglMultiDrawArraysIndirectBindlessNV not implemented");
			Delegates.pglMultiDrawArraysIndirectBindlessNV(mode, indirect, drawCount, stride, vertexBufferCount);
			LogFunction("glMultiDrawArraysIndirectBindlessNV({0}, 0x{1}, {2}, {3}, {4})", LogEnumName(mode), indirect.ToString("X8"), drawCount, stride, vertexBufferCount);
			DebugCheckErrors(null);
		}
		public static void IglooInterfaceSGIX(Int32 pname, IntPtr @params)
		{
			Debug.Assert(Delegates.pglIglooInterfaceSGIX != null, "pglIglooInterfaceSGIX not implemented");
			Delegates.pglIglooInterfaceSGIX(pname, @params);
			CallLog("glIglooInterfaceSGIX({0}, 0x{1})", pname, @params.ToString("X8"));
			DebugCheckErrors();
		}
		public static void FreeMemoryNV(IntPtr pointer)
		{
			Debug.Assert(Delegates.pwglFreeMemoryNV != null, "pwglFreeMemoryNV not implemented");
			Delegates.pwglFreeMemoryNV(pointer);
			LogFunction("wglFreeMemoryNV(0x{0})", pointer.ToString("X8"));
			DebugCheckErrors(null);
		}