I do not know pygame but I notice that you do not call pygame.display.update() until the end of the program. In most GUI applications you need to call update during normal running in order to keep it current.
I have run into a dead end in another OpenGL forum.
I have a basic understanding how (OpenGL) stencilling works.
My stencil is in 2D , no depths.
I am extracting a (circular) part of OpenGL objects, no problem.
I am trying to further manipulate the stencil result.
The task is to enlarge the result and move it to the center of the screen.
I used glTranslatef but it moves the original stencil, not the result. I want to move the result only.
I think my issue is that the stencil was build in "top of the modleview matrix" ( no push /pop) and the objects to be stencilled are in various matrix "stack" - used push / pop.
I understand the "result" is in color buffer, but it sure looks as I am manipulating the stencil buffer, which has been already disabled.
Am I correct in all this?
Do I have to rebuild all on SAME matrixview stack level ?
I am sorry if I am not using correct OpenGL terminology.
First - to avoid "confusion" - I am using term "object" to describe what is created in OpenGL in-between "new " and "end" loop code.
I have a "text (object)" rendered (in OpenGL window) , I need to delete such text and replace it with another one.
I do no want to translate , rotate etc. ... just delete and replace.
What I have tried so far ALWAYS writes OVER the existing text and makes a mess.
Is that possible in OpenGL?
I think I'll try (a hack ) - moving / translating current(text) matrix off the screen....
As a general "rule" NOT to invite uncalled for criticism on my under construction code I am therefore very reluctant to post code.
However, every rule has an exception so here is the latest implementation of "write text message" to OpenGL window.
It writes the message, but in wrong position - irrelevant for now.
(The disabled #ifdef / #endif code was added and that is why the message is written in wrong raster position.The raster position code must be in wrong place. )
It is my understanding that OpenGL keeps the data - bitmap in this case - in video card hardware. So to override / update the data I have to access that particular hardware .
Or in another words - OpenGL "variable / object" cannot be just overwritten like C code.
So I believe I need to keep track of "matrix" where the initial bitmap is written and then
should clear the entire matrix.
Correct me if I am wrong, but glClear would not work SELECTIVELY , it would clear entire buffer.( I did neglected to add "selectively" to the post title )
Yes, glClear does clear the whole viewport - you would then redraw all of the content for the next frame. Matrices only affect what you are going to render in the future, not what you have already sent to be rendered.
Since I just discover that push / pop matrix is "deprecated " clearing all maybe the only decent option anyway. Really not that hard since I keep system state...
Bottom line OpenGL was not the best choise for my application. O well...
I am going to use graphviz to generate state flow charts (i.e. blobs representing states, arrows from one blob to another representing events/transtions) based on a transition table.
There are ways to give hints about the preferred placements, in rough terms, through the "rank" specification. That is not defining the placements, just one input parameter to the placement algorithm. Ideally, I would like to give the user a mechanism to drag one or more blobs to a different position, and then redo the layout but with this one blob pinned.
I do not have the time do decipher the placement algorithm from the source code , so now I hope that either someone knows graphviz in great detail, or the placement algorithms: Is pinning of individual graphic elements at all compatible with the placement algorithm? If it is, can this be done in the dot input language to graphviz? Or in some other way?
I am trying to develop a 2D graphics editor on C#.
In that editor I want continuous co-ordinates where ever the mouse hovers.
I tried using Graphics class in C# but it uses the screen co-ordinates.
Instead I want to use world co-ordinates to draw different shapes.
(Some what like a Autocad Editor, but I don't want to include the complex functionalities)
How can I achieve that?
With a lot of hard work. And what do you mean by, "I want to use world co-ordinates to draw different shapes."? It does not matter what co-ordinate system you use, drawing a shape is much the same process.
Sorry can't reply on your question, but highly recommend you to think about 3d, not 2d. With the development of technology, virtual and augmented reality - 2d images are something that might be undemanding soon enough
I really need your help on this topic. I designing some PSD template websites and apps is this is the right web design or I have to code also? What responsive website means for a web designer is just create the same design for mobile, tablet... or the real meaning of the automatically changing weight for each screen?
And are we able to prototype our web page in Photoshop like the prototyping feature of Adobe XD?
Using OpenTK in devStudio 15 and windows forms on my dell desktop.
When I render a color (eg red = 255, 0, 0, 255), and read the results back it is about, but not quite half of the written value, eg 127, 0, 0, 127.
On a laptop, running the same code, same extremely simple shaders, but different gpu, the red is sometime red on the screen, and sometimes 'half red' and the values I read back are sometimes not exactly half,
Using a framebuffer in opengl instead of Marshalling gives the same results.
All other colors and using r,g,b or any combination gives the same result.
I was planning to use 'designated colors' to identify objects, similar to a shadow map, but the colors are not consistent.
Is this a known or expected behavior? Is it fixable? Running out of things to look for.
Here, there is an article about Creating OpenGL Windows in WPF. But is it possible to embed a pure С++ OpenGL-GLFW or SDL based context into the WForms/WPF, which in its turn will provide controls on the GLFW-context and objects? In other words, WForms/WPF C# editor + C++ GLFW Context.
I am generating a PDF for use in a lasercutter.
The printerdriver for the laser cutter takes vectors with a specific color and stroke-width, and uses them to cut all the way through the material. All rasters/bitmaps are just burnt into the surface of the material.
I would like to be able to take a piece of text and convert it to a vector outline.
I thought this would do it: