drowhunter / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

DrawIndexedPrimitives not rendering anything #811

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I am using C# & SlimDX to draw a 2D image on screen. For that I have just 
changed the SimpleTraingle9 to draw a rectangle using two triangles and then 
texture the rectangle with a bitmap.

Flow of the code is as follows:
1. Create the index buffer.
2. Create the vertex buffer & vertex declaration.
3. Load texture from file.
4. Setting the indices to device.
5. Applying the texture.
6. Setting the vertex declaration.
7. Setting the stream source.
8. Finally calling DrawIndexedPrimitives.

Following is the Debug runtime for reference:

'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e08
9\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger 
option 'Just My Code' is enabled.'SimpleTriangle.vshost.exe' (Managed 
(v4.0.30319)): Loaded 
'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10
.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', 
Skipped loading symbols. Module is optimized and the debugger option 'Just My 
Code' is enabled.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b
77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is 
optimized and the debugger option 'Just My Code' is 
enabled.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7
f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and 
the debugger option 'Just My Code' is enabled.'SimpleTriangle.vshost.exe' 
(Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e08
9\System.dll', Skipped loading symbols. Module is optimized and the debugger 
option 'Just My Code' is enabled.'SimpleTriangle.vshost.exe' (Managed 
(v4.0.30319)): Loaded 
'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sy
nc\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sy
nc.dll', Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): 
Loaded 
'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__
b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading 
symbols. Module is optimized and the debugger option 'Just My Code' is 
enabled.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Users\Pankaj\SlimDX Samples (March 
2011)\Direct3D9\SimpleTriangle9\bin\Debug\SimpleTriangle.vshost.exe', Skipped 
loading symbols. Module is optimized and the debugger option 'Just My Code' is 
enabled.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_64\SlimDX\v4.0_4.0.11.43__b1b0c32fd1ffe4f
9\SlimDX.dll', Skipped loading symbols. Module is optimized and the debugger 
option 'Just My Code' is enabled.The thread 'vshost.NotifyLoad' (0x1cec) has 
exited with code 0 (0x0).The thread '<No Name>' (0x1a60) has exited with code 0 
(0x0).The thread 'vshost.LoadReference' (0x1df4) has exited with code 0 
(0x0).'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Users\Pankaj\SlimDX Samples (March 
2011)\Direct3D9\SimpleTriangle9\bin\Debug\SimpleTriangle.exe', Symbols 
loaded.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Users\Pankaj\SlimDX Samples (March 
2011)\Direct3D9\SimpleTriangle9\bin\Debug\SampleFramework.dll', Symbols 
loaded.The thread 'vshost.RunParkingWindow' (0x914) has exited with code 0 
(0x0).The thread '<No Name>' (0xc60) has exited with code 0 
(0x0).'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b
03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is 
optimized and the debugger option 'Just My Code' is 
enabled.'SimpleTriangle.vshost.exe' (Managed (v4.0.30319)): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c56193
4e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the 
debugger option 'Just My Code' is enabled.Object of type 
SlimDX.Direct3D9.IndexBuffer was not disposed. Stack trace of object 
creation:Object of type SlimDX.Direct3D9.Texture was not disposed. Stack trace 
of object creation:Total of 2 objects still alive.The program '[5544] 
SimpleTriangle.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

But nothing is displayed on screen. So, anybody please go through the attached 
project and let me know where is the flaw?

Thanks,
Pankaj

Original issue reported on code.google.com by karismat...@gmail.com on 8 Jul 2011 at 8:33

Attachments:

GoogleCodeExporter commented 9 years ago
This doesn't appear to be a bug with SlimDX itself.

Original comment by josh.petrie on 8 Jul 2011 at 3:58