Re: newbie questions on OpenGL and C#. I am using NeHe example code
- From: "jbwest" <jbwest@xxxxxxxxxxx>
- Date: Wed, 18 Jan 2006 17:16:51 -0800
"drawing in aspnet" <csharpuser@xxxxxxxxxxx> wrote in message
news:1137604811.645016.281610@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thanks for the responses.
>
> One thing I did that made an immediate difference was moving from C# to
> C++. It seems there is a lot more advice/support for using C++ with
> OpenGL.
>
> I used your glGetString(GL_VENDOR) idea and got back "Intel". Also,
> the value being returned back by ChoosePixelFormat is '4' which, as far
> as I can tell, means hardware acceleration is used. That said, I'm
> almost sure it's not based on some simple tests: 1) it's very slow
> rotating a triangle or square especially when you expand the window,
> and 2) you can have the window covered by another window (TaskManager)
> and the calculations of how many red pixels (for example) are present
> in the window works just fine. This implies that read pixels is not
> reading from the screen but rather from memory?
>
> Also, I did not understand your warning about ReadPixels. My idea was,
> for example, to put a red square down on the drawing surface. Then I'd
> draw some triangles (green) in random spots on the surface. Many would
> cover the red square. The question then is "How many red pixels are
> left". It seems to work fine in my mock-up, but I have not addressed
> issues of speed yet. I was hoping it would all be done on graphics
> card hardware, but perhaps not.
>
> Thanks again.
>
> Dave.
>
> fungus wrote:
>> drawing in aspnet wrote:
>> > instance, I notice that shapes rotate slower when you expand the
>> > window. This suggests that I have done something wrong as (I would not
>> > think) it's an overly complicated view to render.
>>
>> Drawing a polygon isn't free, and the more pixels
>> it covers the longer it takes.
>>
>> > //GL.glFlush();
>> > WGL.wglSwapBuffers(DC);
>> > }
>> >
>> > Notice that I don't have to call glFlush to make things work (it was in
>> > the example code!). How come I got away with that?
>>
>> SwapBuffers() always does a flush for you. Whoever
>> wrote the tutorial did it wrong.
>>
>> > Also, is the drawing really being done on the graphics card? How can I
>> > tell? It occurred to me that maybe it's being done in memory and that's
>> > why things behave slowly.
>>
>> Maybe.
>>
>> Look at the results of glGetString(GL_VENDOR). If it says
>> "Microsoft" and not the name of the people who make your
>> graphics card then you're rendering in software.
>>
>> However, this might be a good thing if you're going to
>> call glReadPixels(). glReadPixels() doesn't work where
>> you have overlapping windows.
>>
>> > Eventually, I would like to write two complicated (non-rotating!)
>> > overlapping polygons to the buffer (NOT the screen) and calculated what
>> > percentage the first polygon covers the second. Someone suggested that
>> > I could use glReadPixels(...) to accomplish this. I would read the
>> > pixels one by one and keep track of which ones were red (polygon#1) and
>> > green (polygon#2).
>>
>> That's likely to be very slow...but maybe that's
>> ok for you.
>>
>>
>>
>> --
>> <\___/>
>> / O O \
>> \_____/ FTB. For email, remove my socks.
>>
>> In science it often happens that scientists say, 'You know
>> that's a really good argument; my position is mistaken,'
>> and then they actually change their minds and you never
>> hear that old view from them again. They really do it.
>> It doesn't happen as often as it should, because scientists
>> are human and change is sometimes painful. But it happens
>> every day. I cannot recall the last time something like
>> that happened in politics or religion.
>>
>> - Carl Sagan, 1987 CSICOP keynote address
>
Get a copy of am OpenGL graphics benchmark, such as Spheremark, and try it
out.
Intel -- not much of a 3D accelerator...
Don't just look at the pixelformat number -- "describe" the pixel format
(DescribePixelFormat()) & parse the return structure
(or use a pixel format dumper like glinfo).
-jbw
jbw
.
- Follow-Ups:
- Re: newbie questions on OpenGL and C#. I am using NeHe example code
- From: drawing in aspnet
- Re: newbie questions on OpenGL and C#. I am using NeHe example code
- References:
- newbie questions on OpenGL and C#. I am using NeHe example code
- From: drawing in aspnet
- Re: newbie questions on OpenGL and C#. I am using NeHe example code
- From: fungus
- Re: newbie questions on OpenGL and C#. I am using NeHe example code
- From: drawing in aspnet
- newbie questions on OpenGL and C#. I am using NeHe example code
- Prev by Date: Re: Free Models and Textures
- Next by Date: Re: stencil shadow volumes
- Previous by thread: Re: newbie questions on OpenGL and C#. I am using NeHe example code
- Next by thread: Re: newbie questions on OpenGL and C#. I am using NeHe example code
- Index(es):
Relevant Pages
|