 |
 | please help me nila12 | 1:44 13 Mar '10 |
|
 |
please help me i need a code project opengl
e-mail: elee_saran@yahoo.com
|
|
|
|
 |
 | SharpGL in a User Control jpkrein | 7:01 10 Feb '10 |
|
 |
I'm having trouble getting OpenGLCtrl working as a user control. It works fine on the form directly, but when I wrap it around the user control, nothing is displayed.
Any clues? The Draw() function is being called...
Thanks.
|
|
|
|
 |
 | Rendering Directly to a texture buffer or pBuffer. jmquinlan | 14:04 26 Jan '10 |
|
 |
Hey,
I'm using multi-threading to render a fairly computationally expensive scene in the background.
I have this working with standard System.Drawing using the OffscreenDC but its extremely slow if I'm using high resolution rendering.
So what I really want to do is hardware accelerate the rendering since it currently
So is there a way to set an open gl texture as the current render target, so that I can render whereever I whenever I need too. Then I would just need to flip the buffers on the main thread once the rendering task is complete, or even get the contents of the texture to a Bitmap object to be applied to a picture control or something.
I guess I'm looking for the equivalent of the FrameBuffer / RenderBuffers?
regards Jm
|
|
|
|
 |
 | Problems with 2 OpenGLControls andrea tosetto | 4:21 3 Nov '09 |
|
 |
First many thanks for this code, it's great!!!
I made a little application which shows a box in a form, I would like to use 2 forms that show the same box from 2 different point of view.
I've got some problem when the 2 opengl controls are on the screen:
when I try to reset(just make a LoadIdentity on model matrix) one of the controls sometimes it is the other control that is reset.
Also if I try to draw a different surface on one control some times it is the other one that draw the surface.
I hope that someone could help me!
Many Thanks,
Andrea
|
|
|
|
 |
 | Can not get link to the sharpgl website? Danielsue | 22:48 14 Oct '09 |
|
 |
Many thanks to Dave for sharing his codes, it's really a good job. But I cannot get link to the website "www.sharpgl.com" recently?
|
|
|
|
 |
 | Low Polygon Limit? cbankier | 20:13 4 Oct '09 |
|
 |
Hi, I've set up a very simple test scene, which simply draws a bunch of cubes. The trouble I'm having is that using SharpGL, only about 18 cubes get drawn, and any number beyond that simply don't appear.
I have set up the exact same sample using c++ and glut, and it works perfectly to any number of cubes.
The scene is simply a modification to the first example, with the spinning cube and pyramid, that ships with SharpGL. I've simple added a loop and offset the position to draw multiple cubes - the code is too trivial to post really, but I can if that helps.
What limit am I hitting? It doesn't seem reasonable that I'm limited to such a low number of polygons in a scene before they stop being drawn. There is no fancy lighting/texturing or anything, and my system can handle much more demanding scenes using c++ and glut, and I get the same result on two different computers.
Is there anything I am missing here to make this simple test work? Any help appreciated! Cheers, Colin.
|
|
|
|
 |
|
 |
I managed to find a workaround for this problem, so I thought I'd post what I did so that it may help implementing a proper solution in a future release.
I found that when I enabled the error checking code in OpenGL.cs, everything worked fine, but without it, half my scene was not being rendered. It seems something was causing the error flag to be set and preventing any further rendering. Simply calling GetError() cleared the flag allowing rendering to continue.
I wasn't able to determine what error was set, and why, but simply modifed the error checking to clear the flag before a Begin and after an End call. This allowed the scene to render properly. Obviously there would be some performance overhead, but this was acceptable for my purposes.
Hopefully this helps solving this issue properly in a future release. Cheers, Colin.
|
|
|
|
 |
|
 |
I had exactly same problem and it took me about 3 hours to find out whats happening. Than I read your post and it was solved in a minute. Thank you very much for posting that solution. I have no ideal what is causing thous problems I always used standard GLUT libs for OpenGL and this looked like much better solution for me, but if there are some more problems like that one I will have to move back to C++ and GLUT
Filip
|
|
|
|
 |
 | Memory leak... WE-JP | 18:50 25 Sep '09 |
|
 |
First of all, great work. This will save me a lot of time.
However, I'm getting a problem with some kind of memory leak. I basically added the pertinent lines from example3 into an existing project, then changed the content of openGLControl1_OpenGLDraw to code I have working in C++. After changing all the gl commands to SharpGL, it seems to be fine at first, but when I run the program the memory usage quickly tops out. Even if I'm not running the program, just having the form designer tab open will cause the same leak.
Any suggestions? Anyone else having this problem?
|
|
|
|
 |
 | Re: Memory leak... noname00 | 23:48 26 Sep '09 |
|
 |
I have just opened example1.exe and have the same problem. Memory usage increases very fast.
I do not have the knowledge to test this, but it seems that a big amount of memory is being allocated when calling
e.Graphics.DrawImageUnscaled(OpenGL.OpenGLBitmap, 0, 0);
and I suppose it is not being released.
I hope this will be fixed, because it is a very useful project.
|
|
|
|
 |
|
 |
You can solve the problem by copying the OpenGLBitmap into a temporary image and calling dispose on that image.
OpenGLControl.cs :
Bitmap bitmap = OpenGL.OpenGLBitmap; e.Graphics.DrawImageUnscaled(bitmap, 0, 0); bitmap.Dispose();
|
|
|
|
 |
|
 |
I thank you for this source. I am difficult for memory leak..
thank you
|
|
|
|
 |
|
 |
Thanks for the suggestion, however, it hasn't worked for me.
Where do you suggest I add this? I added it to the control_OpenGLDraw method, but it didn't change anything.
As a note, I work around this problem by setting the frame rate to zero, then calling a method manually whose body is the same as what my _OpenGLDraw method would be. This solves the problem.
modified on Tuesday, January 26, 2010 3:36 AM
|
|
|
|
 |
|
 |
Go to OpenGLControl.cs and change DrawImageUnscaled to
using(var bmp = OpenGL.OpenGLBitmap) e.Graphics.DrawImageUnscaled(bmp, 0, 0);
Kevin
|
|
|
|
 |
 | Thank You Dave nik195 | 13:12 7 Sep '09 |
|
 |
many thanks for sharing your example code It helps me learning OpenGL I wish I could ask you some questions
Thank You Nik
|
|
|
|
 |
 | SharpGL Website Dave Kerr | 2:06 22 Aug '09 |
|
 |
Hi all,
Apologies to everyone who needs the website - my hosting package has run out and I'm moving to a new system, it'll still be a week before it's up I'm afraid!
|
|
|
|
 |
|
 |
hey, thanks a million for sharing your work. can you just tell us when the website will be up again? and maybe upload the files on a free server in the meantime? thanks again! cheers!
|
|
|
|
 |
 | Improving texture quality tom20 | 22:00 20 Aug '09 |
|
 |
I just wanted to point out that you can improve the texture quality by fixing a mistake.
In Texture.cs Create function: // Set linear filtering mode. gl.TexParameter(OpenGL.TEXTURE_2D, OpenGL.TEXTURE_MIN_FILTER, OpenGL.LINEAR);
Should be: // Set linear filtering mode. gl.TexParameter(OpenGL.TEXTURE_2D, OpenGL.TEXTURE_MIN_FILTER, OpenGL.LINEAR_MIPMAP_LINEAR);
I also added gl.Build2DMipmaps(OpenGL.TEXTURE_2D, 4, width, height, OpenGL.RGBA, OpenGL.UNSIGNED_BYTE, pixelData);
To use mipmapping you have to go to OpenGL and wrap the Build2DMipmaps function.
|
|
|
|
 |
 | NURBS control points location student121 | 7:05 24 Jul '09 |
|
 |
Hi,
Great project!!! Can you give a simple example of how to change the location of the control points (by code, not with the mouse).
Thank you.
|
|
|
|
 |
 | www.sharpgl.com down darck-pl | 23:25 22 Jul '09 |
|
 |
Anyone who has got any materials from sharpgl.com site please send me to fdeebd@jadamspam.pl or share for example here: http://www.easy-share.com/en Author doesn't answer emails...
|
|
|
|
 |
 | Website down? tjdetwiler | 11:27 9 Jun '09 |
|
 |
I noticed sharpgl.com isn't loading... Is this permanent or temporary?
|
|
|
|
 |
|
 |
yeah..i noticed too..
|
|
|
|
 |
 | #D Game MOSTAFApro | 22:09 21 Apr '09 |
|
 |
hi.i need a simple 3D game free source.please help me. my email is mostafa.goodarzi1@gmail.com thank you
|
|
|
|
 |
|
|
 |
 | Orthographic projection in SharpGL? sanctus2099 | 8:13 21 Apr '09 |
|
 |
I tried to set it up before drawing anything. I noticed that the camera is setup by sharpgl before a draw is made. The thing is I want some 2D drawings and thus I need a orthographic projection to draw with after I draw the 3D scene. I used a normal code which should work in C++ but it here it doesn't. If anyone found out how to do this please tell me. Also I can't understand how I can use a arrays for faster drawings.
|
|
|
|
 |