Re: off screen plain

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thank you sooooo much for your help. I'll have to look into using a memory
stream for my data. To describe a little more, I'm receiving a 1024x1 chunk
of data every 18ms. I want to display this data as a waterfall display. So I
created a surface (soon to maybe be a memory stream) of 1024x14000. I also
created a default texture of 1024x1024 to display a portion of the offscreen
surface. I'm using device.updatesurface and sprite.draw2d for that function.
The problem was locking the large surface. I was only locking a single line
at a time as it came in so there was no overlap, but as you well know the
reset wouldn't let me lock the texture anymore. I'm fine letting the display
go black during resize, but I need the data stored. Thank you soo much. I'll
give you an update. Actually had to switch to navite win32 and DrawDibDraw
for the speed and ease of use.

GrkEngineer

"Patrice Scribe" wrote:

> BTW it's left you with the other possibility. You could try something like :
> - create a back buffer that is sized to a "full screen size" and use only
> the relevant portion
> - cancel the Resizing event so that MDX doesn't try to reset the device
>
> This way it should suppress the "reset while resizing" issue. You may
> encounter though other scenario that would still make a device loss (such as
> running a screensaver).
>
> Good luck.
>
> --
> Patrice
>
> "Patrice Scribe" <@> a écrit dans le message de
> news:uhGwTsuVFHA.1200@xxxxxxxxxxxxxxxxxxxxxxx
> > It looks like it doesn't work :
> > - I created a system (also tried with scratch surface). In my main loop I
> > read the first bytes...
> > - During the DeviceLost event I tried to write down to the surface
> > - I try to resize the window, it crashes
> > - To make sure I moved the writing code in the main loop and it works...(I
> > read back the value I've just written so the writing code looks to work).
> >
> > For now I would say that when the device lost even locking system or
> scratch
> > resources doesn't work...
> >
> > It looks like you'll have to write down these data somewhere else such as
> a
> > memory stream so that you can use them once the device is recovered...
> Looks
> > like quite tought. What if the device is lost for sometime. It looks like
> > you are receving data at quite a high speed ??? Make me think about a
> > streaming video or something similar though I don't see what the user will
> > do with the data he missed especially if you keep receiving new data...
> >
> > You still may want to try something similar in case I missed something...
> >
> > --
> > Patrice
> >
> >
> > "Patrice Scribe" <@> a écrit dans le message de
> > news:%23%23HcxatVFHA.2768@xxxxxxxxxxxxxxxxxxxxxxx
> > > I don't remember to have seen something explicit about that. Your best
> bet
> > > is likely to do a quick test (create a system surface and try to fill
> this
> > > surface when the device is lost). My guess would be that it should
> > logically
> > > be allowed (but they might have blocked this scenario for simplicity
> > perhaps
> > > ?)
> > >
> > > The resizing automatically reset the device to adjust the backbuffer
> size.
> > > My understanding is that you'll still have to dispose/recreate video
> > memory
> > > resources likely in the DeviceLost/DeviceReset events... (not a big
> change
> > > but gib enough to destroy the hardware state).
> > >
> > > In the past I saw that some guys are creating a wide backbuffer and are
> > > using only a part of it. Doing so makes reset while resizing useless as
> > your
> > > back buffer is already big enough (trading a bit of memory). I don't
> know
> > if
> > > can do that in Managed code...
> > >
> > > I'm doing currently some experiments about lost devices. IMO this is an
> > area
> > > where the doc lack some details...
> > >
> > > --
> > > Patrice
> > >
> > >
> > > "GrkEngineer" <GrkEngineer@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le
> > > message de news:A1573912-475C-414A-93B0-A5478B2745C0@xxxxxxxxxxxxxxxx
> > > > Hehe, just to clarify my last post. I'm not doing a device reset on
> > > purpose.
> > > > It happens when the form is resized. How do I properly handle this. Do
> I
> > > need
> > > > to do anything in the Form's Resize event? Maybe the Resize begin and
> > end
> > > > events? My question still remains. Can I lock a surface with
> > > > Pool::SystemMemory while the device is reseting or resizing? What
> about
> > > > Pool::Scratch? Thanks
> > > >
> > > > "GrkEngineer" wrote:
> > > >
> > > > > I'm receiving data from a UDP port at 55 Hz and displaying the data
> to
> > > the
> > > > > screen. I've created an off screen plain surface to copy the data to
> > > using
> > > > > either system memory or scratch memory. My problem arises when I try
> > to
> > > do a
> > > > > device reset. The surface becomes disposed. Can I not access the
> > surface
> > > is
> > > > > RAM while the device is in a lost state? This would be horrible for
> my
> > > app. I
> > > > > need to constantly save the data received.
> > > > >
> > > > > Nick Nezis
> > >
> > >
> >
> >
>
>
>
.



Relevant Pages

  • Re: Out of memory with file streams
    ... The memory footprint is not even mentioned in the Javadoc of the resetmethod. ... "Reset" normally means something totally different when talking about IO streams. ... Weak / Soft references would be slick, but there is an extra "quirk" that would have to be addressed. ... resetwill put a RESET marker in the stream in order for ObjectInputStream to recognize that the stream has been reset. ...
    (comp.lang.java.programmer)
  • Re: FileStream.Close() & GarbageCollection - Memory Leak Question
    ... There are two, that I can think of, major sources of memory leaks in an application. ... While you don't have to explicitly call code to free memory allocated in a managed world, you still have to make all the information you got about the lifetime for your data available to the garbage collector. ... stream and releases any resources ... Dispose/Close typically disposes of "scarce" resources, like handles, files, sockets. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: reseting an iterator
    ... The values used to initialize that function might have changed, so 'reset' would have to be carefully defined. ... Python documentation defines a "iterator" as an object ITERATOR ... It is intentionally minimal so it can be used as the universal within-Python object stream protocol. ... Really - rewind is better if it is builtin and preforms where it should. ...
    (comp.lang.python)
  • RE: Error when attempting to open files
    ... Image.FromStream holds the underlying stream while it is in use. ... loading the image data into memory and create an image from that. ... then used for various things such as creating a thumbnail. ... If I simply write the contents of the image to the browser: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Oyster Card System Failure
    ... I've not yet come across r/w memory that can't be reset if theres ... some of the memory as read only - IIRC sector 0 (which contains the ... Initially the card is created with this address as 0. ...
    (uk.transport.london)