Quantcast
Channel: SharpGL
Viewing all 104 articles
Browse latest View live

New Post: Cannot add SharpGL.WinForms Controls?

$
0
0
Had a similar issue... not sure if it is the same or what, but perhaps this helps:
browse to the location where you have unpacked/stored the DLL files and right click on the SharpGL.dll file then select 'Properties'. On the first (General) page, you might find a 'Unblock' button under the 'Security' heading. Click that to unblock the DLL from working in VStudio. Do the same for the SharpGL.WinForms and SharpGL.SceneGraph (or whatever files you need). Then reload VS and see if that fixes the issue (did for me, was doing the WPF example in VS2010 with VB.NET).

@dwmkerr: thanks for the project, tutorial & samples... awesome job!

New Comment on "Sample Applications"

$
0
0
Source code would be very helpful. Without, the Samples are really just Teasers... Does anyone have access to them, know where they are? I'm stuck on implementing a vertex buffer and see it implemented in the samples but don't know how to reproduce... Cheers

New Comment on "Sample Applications"

$
0
0
NVM... found them. For anyone else looking & not finding: the samples' source code is included with the full source code on the GitHub site (download as Zip then under /source/sharpgl/..). Probably would have made sense to provide the source code for the examples & tools separately... but maybe that's just me.

New Post: SharpGL & OpenGL backward compatibility

$
0
0
Hi,

while testing with Sharp GL (OpenGL Version 4.0) I found that a lot of the functions I remembered from a training some years ago did not work (e.g. Begin(), End(), Vertex(), Perspective, ...).

When I tried using the SharpGL libraries compiled in DEBUG mode, I got a the error message "Extension function XXX not supported". This message is always created when you specify an OpenGL version you want to use where the used method is marked as deprecated.

Which methods are deprecated and which not is explained in the OpenGL X.XX API Quick Reference Cards provided here:
http://www.opengl.org/sdk/docs/
Every content shown in blue is deprecated.

Currently there is no build in possibility (that I've found) that enables backward compatibility.

For me, I've changed the class RenderContextProvider; Method UpdateContextVersion to:
        protected void UpdateContextVersion(OpenGL gl)
        {
            //  If the request version number is anything up to and including 2.1, standard render contexts
            //  will provide what we need (as long as the graphics card drivers are up to date).
            var requestedVersionNumber = VersionAttribute.GetVersionAttribute(requestedOpenGLVersion);
            if (requestedVersionNumber.IsAtLeastVersion(3, 0) == false)
            {
                createdOpenGLVersion = requestedOpenGLVersion;
                return;
            }

            //  Now the none-trivial case. We must use the WGL_ARB_create_context extension to 
            //  attempt to create a 3.0+ context.
            try
            {
                int[] attributes = 
                {
                    OpenGL.WGL_CONTEXT_MAJOR_VERSION_ARB, requestedVersionNumber.Major,  
                    OpenGL.WGL_CONTEXT_MINOR_VERSION_ARB, requestedVersionNumber.Minor,
                    OpenGL.WGL_CONTEXT_FLAGS_ARB, 0,
                    OpenGL.WGL_CONTEXT_PROFILE_MASK_ARB, OpenGL.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
                    0
                };
                var hrc = gl.CreateContextAttribsARB(IntPtr.Zero, attributes);
                Win32.wglMakeCurrent(IntPtr.Zero, IntPtr.Zero);
                Win32.wglDeleteContext(renderContextHandle);
                Win32.wglMakeCurrent(deviceContextHandle, hrc);
                renderContextHandle = hrc; 
            }
            catch(Exception)
            {
                //  TODO: can we actually get the real version?
                createdOpenGLVersion = OpenGLVersion.OpenGL2_1;
            }
        }
I changed the int[] attributes part, where you can specify how your render context should be initialized.

you can find an explanation of the attributes under:
https://www.opengl.org/registry/specs/ARB/wgl_create_context.txt

As I expect others to have the same problem as me, maybe the controls can be modified to have a "backward compatibility mode enabled" property.

Another "problem" with the current controls is, that it uses methods which are deprecated in higher version.

For example:
/// <summary>
        /// Handles the SizeChanged event of the OpenGLControl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.SizeChangedEventArgs"/> instance containing the event data.</param>
        void OpenGLControl_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            //  Lock on OpenGL.
            lock (gl)
            {
                int width = (int)e.NewSize.Width;
                int height = (int)e.NewSize.Height;
                gl.SetDimensions(width, height);

                //  Set the viewport.
                gl.Viewport(0, 0, width, height);

                //  If we have a project handler, call it...
                if (width != -1 && height != -1)
                {
                    var handler = Resized;
                    if (handler != null)
                        handler(this, eventArgsFast);
                    else
                    {
                        //  Otherwise we do our own projection.
-->                        gl.MatrixMode(OpenGL.GL_PROJECTION);
-->                        gl.LoadIdentity();

                        // Calculate The Aspect Ratio Of The Window
-->                        gl.Perspective(45.0f, (float)width / (float)height, 0.1f, 100.0f);

-->                        gl.MatrixMode(OpenGL.GL_MODELVIEW);
-->                        gl.LoadIdentity();
                    }
                }
            }
        }
As each call to a deprecated method throws an exception and as exception handling is expensive I would guess that this might also have an impact on performance (Maybe not the SizeChanged eventhandler as shown above, but definitely the DrawText call for the FPS).

Cheers

Thomas

Commented Issue: Simple VBO Example [840]

$
0
0
Promote Josiah's simple VBO sample to a full sample and include in the project: http://sharpgl.codeplex.com/discussions/349729#post885811
Comments: ** Comment from web user: tygill6 **

How do you use a texcordarray with the vertexbuffer?

New Post: Nothing is shown when using the SharpGL control under a WPF user control

New Post: Cannot add SharpGL.WinForms Controls?

$
0
0
@joeegar thanks for posting the tip and your comments!

New Post: Extension function glGenFramebuffersEXT not supported

$
0
0
dwmkerr wrote:
Hi CamCam, You're graphics card drivers don't support the function glGenFramebuffersEXT - so in any sample application that's not working, go to the OpenGL control, select it, under 'properties' there's a property called 'RenderContextProvider' change it from FBO (a hardware accelerated context that uses glGenFramebuffersEXT) to 'DIBSection' - DIBSection'll work on ANY card. :)
Hi Dave,
 In the Tools. I still can't find the OpenGL control on VS 2010  

Can you give detailed steps?Where to find OpenGL control?

New Post: Extension function glGenFramebuffersEXT not supported

$
0
0
Evorio wrote:
Hi Dave, Now I am working on a SharpGL project using Visual Studio 2010. When I tried to run a sample project from VS 2010, I met a same problem CamCam had before.   I have updated my display driver but what I wanna ask you is how do I change FBO value to DIBSection (for RenderContextProvider part)?   I still can't find the OpenGL control on VS 2010 you mentioned earlier above. Perhaps you can show me the step-by-step solution for this. I am not used to VS 2010 tools so I got a little lost here. By the way, my graphic card is SiS Mirage 3 Graphics. Not a very good one for computer graphics. Anyway, thank you for your concern.   Evorio
Hi,

depending on the Version you set up to use, you might also run into backward compatibility problems.

see:
https://sharpgl.codeplex.com/discussions/567675

Cheers Thomas

New Post: Querying for max texture units returns 0

$
0
0
Hello, when I call OpenGL.GetInteger, passing 0x84E2 or 34018, I get 0.

I am running this on Windows 7 Pro on a Dell Latitude E5520.

Is there something I should be doing on my system to support textures?

I am not running the most recent NuGet version and install have the project source linked to my code. Is there a way I can confirm what version I am running?

New Post: IGES question

$
0
0
We would have some information, if anyone has had experience of export of the three-dimensional model in IGES data exchange format.

Is there some library recommended to perform these operations? Possibly opensource?

Thanks.

Verremmo avere qualche informazione, se qualcuno ha avuto esperienza dell'esportazione delle modello tridimensionale nel formato di interscambio dati IGES.

Esiste qualche libreria consigliata per eseguire queste operazioni? Possibilmente opensource?

grazie.

Commented Issue: Bug, can't find RenderTrigger property 2.1 [1084]

$
0
0
RenderTrigger property not exists same in WPF and WinForm control. I download source code for samples, find example with RenderTrigger and property exists there, but when you create new project SharpGL wpf or winform, property not exists.
Comments: ** Comment from web user: Icarion **

Well, I'm afraid its not solved in 2.3.

I just downloaded it, added the references to my WPF Application project and tried to find the RenderTrigger property but to no avail.
Could you please either have a look at it again or if I'M wrong please point me to where/how to access that property?

Thanks in advance,
Killian

New Post: GluquadricObj in sharpGL

$
0
0
Hi, i am trying to draw a cylinder with gl.cylinder.
For the 1st input, I can not found the GLUquadricObj function to declare the object.
Is there any difference method in sharpGL?
Thanks!

Created Unassigned: Modern OpenGL sample does not eork [1607]

$
0
0
I'm trying both SharpGL version(2.4, 2.3) of this sample on 2 different AMD GPU(Radeon HD 8650G, Open GL ver. 4.2; Radeon HD 4500 OpenGL ver. 3.3). They both are showing same incorrect result (see attached image or at http://advameric.com/downloads/screenshot.png). It even seems the final image does not depend on a geometry and is same for different vertices set. The ObjectLoadingSample does not work in retained mode on these GPUs either. It shows a blank window. In both cases OpenGL Version property of SharpGL.OpenGLControl is set to value corresponding to GPU OpengGL version.

New Post: IBL file export (Internal Boundary Layer)

$
0
0
someone knows the technical specifications of the format IBL?
In SharpGL are present?

Thanks

qualcuno conosce le specifiche tecniche del formato IBL?
In SharpGL sono presenti?

grazie

Commented Unassigned: Modern OpenGL sample does not work [1607]

$
0
0
I'm trying both SharpGL version(2.4, 2.3) of this sample on 2 different AMD GPU(Radeon HD 8650G, Open GL ver. 4.2; Radeon HD 4500 OpenGL ver. 3.3). They both are showing same incorrect result (see attached image or at http://advameric.com/downloads/screenshot.png). The ObjectLoadingSample does not work in retained mode on these GPUs either. It shows a blank window. In both cases OpenGL Version property of SharpGL.OpenGLControl is set to value corresponding to GPU OpengGL version.
Comments: ** Comment from web user: robinsedlaczek **

Hi Yuriberi!

On my nvidia gtx 580 it looks fine. Please see the attachments. Do you have the chance to test it on other hardware? I do not know any issue with radeon graphic adapters. I'll try to find such hardware and reproduce the issue.

Thanks for posting it here!

New Post: GluquadricObj in sharpGL

$
0
0
Hi! There is the SharpGL.SceneGraph.Quadrics namespace where you can find a wrapper for a cylinder. Is that what you are looking for?

Updated Wiki: Documentation

$
0
0

SharpGL Documentation

The main SharpGL documentation can be found below.

Fundamentals

Read this before getting started with SharpGL - the fundamentals describe how the library works and how you use it. This fundamental information is a great place to start with SharpGL.

Sample Applications

The SharpGL Sample Applications demonstrate key features of SharpGL for WinForms and WPF. They're a great way to learn how to use SharpGL and provide potential starting points for your own applications.

Tools

SharpGL comes with some useful tools to help you in your projects. Find out more about the tools and how they work.

The SharpGL Visual Studio Extensions

SharpGL comes with a VSIX package that includes project templates for SharpGL powered applications. This page details the templates and how they work.

SharpGL Resources

Not technically documentation, the pages below are useful resources for SharpGL - supported features, the roadmap and more.

OpenGL Compatibility 

A description of which core functionality and what extensions are supported in SharpGL. Check what extensions are supported and what features you need.

Roadmap

Where is SharpGL going - what you can expect in the future!

Commented Unassigned: Modern OpenGL sample does not work [1607]

$
0
0
I'm trying both SharpGL version(2.4, 2.3) of this sample on 2 different AMD GPU(Radeon HD 8650G, Open GL ver. 4.2; Radeon HD 4500 OpenGL ver. 3.3). They both are showing same incorrect result (see attached image or at http://advameric.com/downloads/screenshot.png). The ObjectLoadingSample does not work in retained mode on these GPUs either. It shows a blank window. In both cases OpenGL Version property of SharpGL.OpenGLControl is set to value corresponding to GPU OpengGL version.
Comments: ** Comment from web user: yuriberi **

I figured out that a fix for this problem is explicit location definition in the vertex shader.
I've changed Shader.vert adding the location definitions
layout(location = 0) in vec3 in_Position;
layout(location = 1) in vec3 in_Color;

This fixes the issue.

Commented Unassigned: Modern OpenGL sample does not work [1607]

$
0
0
I'm trying both SharpGL version(2.4, 2.3) of this sample on 2 different AMD GPU(Radeon HD 8650G, Open GL ver. 4.2; Radeon HD 4500 OpenGL ver. 3.3). They both are showing same incorrect result (see attached image or at http://advameric.com/downloads/screenshot.png). The ObjectLoadingSample does not work in retained mode on these GPUs either. It shows a blank window. In both cases OpenGL Version property of SharpGL.OpenGLControl is set to value corresponding to GPU OpengGL version.
Comments: ** Comment from web user: dwmkerr **

Hi yuriberi,

Thanks for posting the fix, that's very helpful! I've raised a ticket on GitHub where I'm tracking issues now and will make sure this is applied to the next release:

https://github.com/dwmkerr/sharpgl/issues/54

Viewing all 104 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>