TysonMay / monoxna

Automatically exported from code.google.com/p/monoxna
0 stars 0 forks source link

RenderTarget is not implemented #72

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello. Will you plan implement RenderTarget class in the near future? We trying 
to run our Xna game to the MonoXna and it would be very useful to us. Maybe I 
can help somehow with coding if you tell me what to do.

Original issue reported on code.google.com by whyl...@gmail.com on 12 Dec 2010 at 4:21

GoogleCodeExporter commented 8 years ago
I'm sorry for the late reply, but I've been extremely busy lately.. I'm back 
now though.

Yes, we have plans of implementing RenderTarget, but I've been focusing on the 
content pipeline support in the past.

I will do some research to see if the class can be implemented in hurry to 
fulfill your request. 

Original comment by lav...@gmail.com on 4 Jan 2011 at 7:47

GoogleCodeExporter commented 8 years ago
I've commited a preliminary implementation of RenderTarget and RenderTarget2D. 
Please try it and let me know how it goes.

Original comment by lav...@gmail.com on 8 Jan 2011 at 10:02

GoogleCodeExporter commented 8 years ago
I tried the code that draws the text on the RenderTarget2D surface, gets the 
texture from it and draws the result texture. Application successfully compiled 
and started, blue screen is showed. But nothing draws on the screen and after 
about 2-3 seconds application receives SIGSEGV signal and falls down. There is 
an application output:

Loaded assembly: /home/whyleee/Projects/TestMXNA/TestMXNA/bin/Debug/TestMXNA.exe
Loaded assembly: 
/home/whyleee/Projects/TestMXNA/TestMXNA/bin/Debug/Microsoft.Xna.Framework.Game.
dll [External]
Loaded assembly: 
/home/whyleee/Projects/TestMXNA/TestMXNA/bin/Debug/Microsoft.Xna.Framework.dll 
[External]
Loaded assembly: 
/usr/lib/mono/gac/Tao.Sdl/1.2.13.0__9c7a200e36c0094e/Tao.Sdl.dll [External]
Loaded assembly: /usr/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll 
[External]
Loaded assembly: 
/usr/lib/mono/gac/Tao.DevIl/1.6.8.3__7ec4053013524957/Tao.DevIl.dll [External]
Loaded assembly: 
/usr/lib/mono/gac/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configur
ation.dll [External]
Loaded assembly: 
/usr/lib/mono/gac/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll [External]
Loaded assembly: 
/usr/lib/mono/gac/Tao.OpenGl/2.1.0.12__1ca010269a4501ef/Tao.OpenGl.dll 
[External]
Stacktrace:

Native stacktrace:

    /usr/bin/mono() [0x48563b]
    /usr/bin/mono() [0x4d275f]
    /lib/libpthread.so.0(+0xfb40) [0x7feb33f00b40]
    /usr/lib/nvidia-current/libGL.so.1(+0x2ec769) [0x7feb2a823769]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

My configuration is:
Distro:        Linux Mint 10 x86_64
Kernel:        2.6.35-22-generic
Video Card:    NVIDIA GeForce GTS 450
Video Driver:  260.19.06
Mono Runtime:  2.6.7

I attached MonoDevelop project to this message with code of my application.

Original comment by whyl...@gmail.com on 9 Jan 2011 at 12:47

Attachments:

GoogleCodeExporter commented 8 years ago
The code looks fine. I'm hoping that it is a problem with the dependencies. I'm 
on Ubuntu 10.10 with Mono 2.6.7 and Tao.OpenGL 3.0.

I will try your code to make sure I haven't missed anything.

Original comment by lav...@gmail.com on 9 Jan 2011 at 1:15

GoogleCodeExporter commented 8 years ago
I tested your code, both in MonoXNA under Ubuntu 10.10 and MS XNA 3.1, and 
there are some issues in both cases.

You call Clear() before you set the texture target, this does not work in 
Windows (at least not on my machine)

In the MonoXNA implementation of render targets, each new allocation of a 
render target allocates a new buffer for the depth buffer information. This 
data is released when the render target object is disposed (either manually or 
by GC). I placed the allocation outside the game loop, and that fixed the 
crash. 

But your code also invoke a previously unknown issue with blending, which is 
why nothing is rendered, or at least so I think from what I've been able to 
figure out so far. I'll investigate this further.

I've attached my test client so you can test it on your setup. You should 
probably create a new solution and project setup for it though, since mine 
require that you install our MD addin.

Original comment by lav...@gmail.com on 9 Jan 2011 at 10:24

Attachments:

GoogleCodeExporter commented 8 years ago
I checked your code on my computer and it works well.

Original comment by whyl...@gmail.com on 19 Jan 2011 at 8:27