|
Hi,
my program contains a rather time consuming loop to send newsletter emails (in no separate thread). Within this loop, the screen shall be updated after every loop circle, i.e. after every message being sent (simply updating the number of the sent messages and setting a hook in the addressees grid). So far no problem. Now, after some minutes running the procedure alone, the standard win logo screensaver absorbs the screen. And if I'm now returning to my program window by hitting any key, the screen gets frozen, although the program behind keeps running well. The screen will not be updated until the whole loop has been worked off. This happens although there is a .refresh command in every loop circle.
Does anybody have a piece of advice how to fix this?
Cheers,
Wolfgang, Berlin/Germany
|
|
|
|
|
What language is your code? Using .NET?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
I'm using VB.NET.
Wolfgang
|
|
|
|
|
Hmmm... I'm not a VB coder but...
You mentioned you call .refresh every iteration of the loop. Are you referring to the
Control.Refresh() method? If so, are you calling it on just one control or on the window itself?
This type of problem is common when you are consuming all of the UI threads time and not
allowing windows messages to get dispatched.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Well, actually I'm calling both, the Me.refresh (which presumably corresponds to the this.refresh in C#) at the beginning, and the control.refresh method at the end of each loop circle, but this doesn't help. It seems that at runtime the screen upadate is being postponed behind the other programmatical tasks of the loop as a kind of secondary task.
If so, what would you recommend to give the screen update back its demanded priority?
Wolfgang
|
|
|
|
|
When the screensaver is removed, all windows will be invalidated and eventually will redraw
themselves. If you are in a loop then the WM_PAINT message sent to the app as a result of this
invalidation will not get processed until the loop ends.
That, said, I would expect Refresh() to immediately redraw the window. Maybe I'm wrong about
that. What you're describing sounds like the delayed WM_PAINT handling described above.
Maybe try this every iteration of your loop (I'm assuming Me is a form, not just a control on a
form - I'm not a VB coder so I don't know what "Me" generally is ):
Me.Invalidate();
Me.Update();
instead of Refresh();
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
meanwhile I tried your suggestion. Result: negative. With the .invalidate() and the .update() command the form doesn't redraw itself at all, not even before the screensaver has been invoked. And the documentation of the .refresh() method in principle promises exactly, what I'm looking for: "... Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control.)" But it doesn't do so, unfortunately.
Do you have any further idea, how I get my app paying attention to the WM_PAINT handling, after the screensaver has been removed (if this is the real problem)?
Greetings from Berlin, Germany
Wolfgang
|
|
|
|
|
What happens if you drag another window across your app's form when it's in the loop?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
unfortunately, I've to leave immediately for a business trip until June, 22nd (I'm somewhat in a hurry to get the plane...). I'm going to try later what happens when dragging another window across the loop's form. So far thanks for your efforts, I get in touch with you as soon as I'm back.
All the best
Wolfgang
|
|
|
|
|
... not to forget, Mark, that the problem doesn't occur as long as the screensaver isn't interfering. This, i.e. the win screensaver, seems to change the preferences in the GUI of my program.
Wolfgang
|
|
|
|
|
yes another bone and vertex question...
I got my bone-system to work properly and I already modelled some simple characters in 3ds Max... the problem now is:
how do I assign the different vertices to my bone system?
Can I use some scripting in max? or should I use a different file-container different from .3ds?
the problem of 3ds is that I cannot assign vertex groups... Or when I do put them in a group the edges between the objects get broken.
I have got a pretty good 3DS-Loader but assigning each vertex to a bone by hand is... well... damn enerving. should I convert my model or is there a way of marque selecting vertices and grouping them (and the faces don't get broken) so I can find those groups for my bones system?
Or is it simpler to try to write an algo that assigns each vertex to the nearest bone (and correcting this result by hand)??
thanx in advance
(PS: I'm using OpenGL and C++, of course)
|
|
|
|
|
zqueezy wrote: I'm using OpenGL and C++, of course
http://home.gna.org/cal3d/[^]
http://download.gna.org/cal3d/documentation/modeling/tutorial.html[^]
not sure if you are wanting to do it all yourself, of find a library that does it for you (and then you are restricted to its bone design). At the very least you can peek at the code and see how they do the binding.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Hi,
I am writing a game and planning to use DTED files for terrain generation.There is an example(http://www.geocities.com/oldjajubear/dtedview.zip) for viewing in 2D. I just need the help of this forum in using DTED+OpenGL to modify this code
to disaply DTED in 3D.
|
|
|
|
|
dgpdgp wrote: I am writing a game and planning to use DTED files for terrain generation.There is an example(http://www.geocities.com/oldjajubear/dtedview.zip) for viewing in 2D. I just need the help of this forum in using DTED+OpenGL to modify this code
to disaply DTED in 3D.
OpenSceneGraph directly supports the building and drawing of terrain using DTED:
http://www.openscenegraph.com/index.php[^] or
http://www.delta3d.org/[^] (based on OSG)
you can also use many algorithms at Vterrain.org (including the site's owner's code):
http://www.vterrain.org/LOD/[^]
http://www.vterrain.org/Request/index.html[^] (virtual terrain project's code) Ben is a good guy too.
http://www.vterrain.org/index.html[^] (the root page for information in many terrain related visualization issues).
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Hi Expert(s),
I need to draw 100 line with e.Graphics.DrawLine() command. Problem is that, that when i minimize my window all 100 line are vanish. I learn some topic on device context but not got idea how to do.Wht i wanna to do is that
i am drawing line from many differenct event says with 10-20 mouse down events of picture box.So here how do i write code in my OnPaoint() .Pls Pls giv me solution.
Help wud b really appreciated.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
You need to store any information you need to redraw all the lines when you receive the
WM_PAINT notification.
For a DC to do the drawing to, you can use the BeginPaint/EndPaint APIs or get a DC for the
window and handle the validating of the update region of the window yourself.
What language are you coding in?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am currently working on a drawing application using openGL and C#..........having a nightmare trying to grasp concept of selection/picking...
My application will be drawing 2D(later 3D) objects...the user will be able to select any edge of a polygon and move it around/modify it..
I have seen few tutorials but they were not really useful..i am still confused about how the retreived information in selection mode(Hits records) will help in performing above mentioned editing functions
kindly help
please suggest links/tutorials (better if in C#)
thanks
|
|
|
|
|
Have you tried http://nehe.gamedev.net. It's in C++ but the concept is the same for selection. Here[^] is the tutorial for selection/picking. It mentions something about gluPickMatrix() so i don't know if that's the same in C#.
Hope that helps.
--------------------------------
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
The gamedev tutorial is definatly a good place o start.
The basic concept is as follows.
You have an object (say a box) give the box a bounding box or sphere. Pass the center vertex position of the box through the projection pipeline (i.e. project it onto the screen, there are opengl matrices that can do this). This will give you the coords of the object in 2d screen space. You also have to find the screen space size of your bounding area (same kind of method) once you have these you can test the mouse coords against the screen space bounding area.
That isn't the best explination ever but it's somthing to start on. I'll see if I can dig out the code to project into screen coords
|
|
|
|
|
I'm seeking a video encoder software for a camera control system.
The video encoder should provide an SDK and it should be able to support video streaming's buffer size less than 1s or near real time.
Could you please recommend some alternatives (open source/commercial)?
|
|
|
|
|
Would you be able to recommend a virtual camera utility (freeware/shareware)?
The utility needs to be able to read in an video file (such as video.avi) and outputs the video stream as a virtual camera device.
|
|
|
|
|
Until now i used the blend function glBlendFunc(GL_SRC_ALPHA,GL_ONE) to use transparency. But the problem with that is that although it blends black with the background to make it transparent it also blends all colours. That is, it adds the colour with the background colour so black becomes transparent but red blended with green(?) will give white.
The point is that i don't want to blend all colours but simply make a vertex/poly transparent if i set the colour to glColor4f(red, green, blue, alpha) so that the image will have the colour (red,green,blue) but also transparent, instead of blending red, green and blue if you know what i mean.
Here are the params i set on init (if it helps):
glShadeModel(GL_SMOOTH);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glDepthFunc(GL_LEQUAL);
glEnable(GL_COLOR_MATERIAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
Can anyone help me please?
----------------------------------
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
VizCoder wrote: to use transparency.
the question is actually more complex than you think. OpenGL doesn't know how to do transparency. "Alpha blending" applies a mathematical function to the source and destination values of color from raster buffer to new data, to achieve a "similar" appearance. You can do better than this and get close to true transparency, but you must get smart on ordering of your scene and combination of blends. You've already realized that color add goes high to white which may not be the look you want. There are other blending functions, combining them with ordered triangles, you can get the look you want through design more than automation. True OpenGL transparency takes a bit of thought and work.
http://www.opengl.org/resources/faq/technical/transparency.htm[^]
http://www.derivativeinc.com/Tools/Touch000/Manual/Tips/011_AlphaBlending/AlphaBlending.asp[^]
http://www.sjbaker.org/steve/omniv/alpha_sorting.html[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I know about sorting the vertices and all that. That's not my problem. Why can't OpenGL simply blend the colour with the alpha value so that an alpha of 1.0 will mean (r,g,b) stays as (r,g,b) but alpha of 0.5 will blend 1/2 the red of the source with 1/2 the red of the dest (& same for green & blue). I keep reading that glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) does that trick but it doesn't work for me. Black came out as black even when alpha was at 0.
Or am i just doing something wrong?
--------------------------------
Customer in computer shop: "Can you copy the Internet onto this disk for me?"
|
|
|
|
|
The problem is that blending really doesn't know all that goes into the accumulation of color in the raster image. This is where some of the other layers come in. You can utilize a overlay or underlay to improve blending by providing a forced layer of "this is different than that". have you tried the blend program from the Red book on opengl? http://cs-sdl.sourceforge.net/index.php/Red_Book_Chapter_07[^] http://www.opengl.org/resources/code/samples/redbook/[^]
The issue is complicated because of performance consideration. True blending would mean that all objects are blended independently on their own layer such that the blend of background and foreground and even midground can all be weighted appropriately. But it doesn't work that way since all we have is a raster "destination" plane and a source object. Once the blend operation is finished the net result is a new destination plane (the raster plane) and all you can do is change the calculation and whether or not you write to the z-buffer which prevents something else from blending.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|