flaccidware / oglsuperbible5

Automatically exported from code.google.com/p/oglsuperbible5
0 stars 0 forks source link

Chap 2 - Triangles - GLBatch has to be initialized twice? #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile & run the code from Chapter 2 in either VS 2008 or 2010

What is the expected output? What do you see instead?
Expected Output: Blue background with red triangle.
What I see: Blue background

What version of the product are you using? On what operating system?
I've used GLtools and freeglut_static straight from SVN, Revision #193. Windows 
7 64-bit SP1

Please provide any additional information below.
No compiler warnings or errors, everything is linked up just as the book says. 
In order for the code to work, I have to declare the following three lines 
twice consecutively:

triangleBatch.Begin(GL_TRIANGLES, 3);
triangleBatch.CopyVertexData3f(vVerts);
triangleBatch.End();

How do I get his to work without having to declare my triangles twice?
Source attached.

Original issue reported on code.google.com by ceash...@gmail.com on 27 Aug 2011 at 9:07

Attachments:

GoogleCodeExporter commented 9 years ago
Correction, only the following line needs to be duplicated to make the code 
work:
triangleBatch.CopyVertexData3f(vVerts);

So this corrects my problem, but doesn't solve the main issue.

triangleBatch.Begin(GL_TRIANGLES, 3);
triangleBatch.CopyVertexData3f(vVerts);
triangleBatch.CopyVertexData3f(vVerts); //Call this a second times makes it 
work?
triangleBatch.End();

Original comment by ceash...@gmail.com on 5 Sep 2011 at 12:45

GoogleCodeExporter commented 9 years ago
I've found that ATI Catalyst 9.x works with this code (and any other code in 
the book) unaltered, but does not work on any newer drivers ATI Catalyst 10.x 
or 11.x. 

Can anyone confirm this? This may be an issue just with using those drivers on 
this particular graphics card. (ATI HD 4870x2)

Original comment by ceash...@gmail.com on 7 Nov 2011 at 12:26

GoogleCodeExporter commented 9 years ago
I have a HD4870X2 as well and I am experiencing lots of problems with the 
example code. Often it can be fixed by making a second call to whatever Copy 
function, but later on the various GLTriangleBatch class objects sometimes 
don't render at all. There doesn't seem to be any rhyme or reason to it. I 
haven't been able to find the cause of this problem yet.

I haven't tried using Catalyst 9.x, but I will. The code executes perfectly on 
other machines.

Original comment by mooncabb...@gmail.com on 13 Nov 2011 at 2:21

GoogleCodeExporter commented 9 years ago
OK so it turns out it's a bug specific to the HD4870X2's window drivers for 
Catalyst 10.x & 11.x, where glBufferData() doesn't copy the data as it should. 
Calling CopyVertexData etc twice works because the first call calls 
glBufferData() and subsequent calls call glBufferSubData(), which works fine.

I found the same thread as you ceashure, which I will post here for anyone else 
with these difficulties: 
http://forums.amd.com/forum/messageview.cfm?catid=392&threadid=141115

Hopefully AMD fix this soon, but I wouldn't get my hopes up.

Original comment by mooncabb...@gmail.com on 13 Nov 2011 at 4:32

GoogleCodeExporter commented 9 years ago
Yes, thanks for posting that here. I was starting to think I was the only one 
in the world experiencing this issue. lol

Hopefully AMD will get this fixed in the next driver.

Original comment by ceash...@gmail.com on 14 Nov 2011 at 11:37

GoogleCodeExporter commented 9 years ago
O, if you could post in that AMD forum as well, that would be great. They may 
take the bug more seriously if many people are having the issue.

Original comment by ceash...@gmail.com on 14 Nov 2011 at 11:39

GoogleCodeExporter commented 9 years ago
Sorry, I kinda gave up on OpenGL until I could get a card that works properly :P

I did try posting on that thread on the AMD forums, but it wouldn't let me at 
the time.

I've posted now though.

Original comment by mooncabb...@gmail.com on 20 Dec 2011 at 8:14