Giter Site home page Giter Site logo

shrikantd / opengles-book-samples Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 7.01 MB

Automatically exported from code.google.com/p/opengles-book-samples

Java 5.21% C 26.82% C++ 1.97% Makefile 0.14% HTML 61.01% JavaScript 0.95% Logos 0.23% GLSL 0.02% CSS 0.25% Objective-C 3.41%

opengles-book-samples's People

Contributors

danginsburg avatar

Watchers

 avatar

opengles-book-samples's Issues

Empty viewport when running examples on Tegra 2 / Linux / X11

What steps will reproduce the problem?
1. Compiled the LinuxX11 examples on Ubuntu 10.10 on a Tegra 2 (Seco T20 board)
2. Run any example
3. Example run without crash, but viewport remains empty (not even black)


What is the expected output? What do you see instead?

Examples do not show 3d output. On the other hand, NVIDIA's examples are 
running fine, and custom test code using Qt 4.7+GLESv2 works fine too.

What version of the product are you using? On what operating system?

Seco's BSP running Ubuntu 10.10 and NVIDIA L4T R12 drivers on Seco T20 Tegra2 
platform.

Please provide ay additional information below.

Compiles fine without error and executes without segfault. It's quite 
unexpected since it seems that this code was in fact tested on Ubuntu 
10.10/Tegra2..

Original issue reported on code.google.com by [email protected] on 15 Jun 2012 at 7:11

glDrawElements call with wrong type in Simple_TextureCubemap example

What steps will reproduce the problem?
1. Compile the code of Chapter_9/Simple_TextureCubemap.
2. Try to execute compiled binary with OpenGL ES 2.0 lilbrary

What is the expected output? What do you see instead?
Expected result: To see a sphere.
Real result: No sphere.

What version of the product are you using? On what operating system?
Source from trunk (2012-05-27).
Using Mali's OpenGL ES 2.0 emulator.

Please provide any additional information below.
glDrawElements is called with type GL_UNSIGNED_INT which according to OpenGL ES 
2.0 specification is not supported. That generates GL_INVALID_ENUM error.
For reference see the description of glDrawElements() at: 
http://www.khronos.org/opengles/sdk/docs/man/

To be fixed GL_UNSIGNED_SHORT should be used instead of GL_UNSIGNED_INT. 
esShapes.c and and esUtil.h files should be changed accordingly. You can find 
my fix bellow. I've just compiled this example and not the other. So there may 
be the same error in them also.

--------------------- Fix start -----------------------

diff -r -x.svn -u3 
svn_trunk/opengles-book-samples-read-only/LinuxX11/Chapter_9/Simple_TextureCubem
ap/Simple_TextureCubemap.c 
workCopy/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.c
--- 
svn_trunk/opengles-book-samples-read-only/LinuxX11/Chapter_9/Simple_TextureCubem
ap/Simple_TextureCubemap.c  2012-05-27 13:25:58.376169537 +0300
+++ workCopy/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.c    2012-05-27 
13:57:57.293899986 +0300
@@ -34,7 +34,7 @@
    int      numIndices;
    GLfloat *vertices;
    GLfloat *normals;
-   GLuint *indices;
+   GLushort *indices;

 } UserData;

@@ -184,7 +184,7 @@
    glUniform1i ( userData->samplerLoc, 0 );

    glDrawElements ( GL_TRIANGLES, userData->numIndices, 
-                    GL_UNSIGNED_INT, userData->indices );
+                    GL_UNSIGNED_SHORT, userData->indices );
 }

 ///
diff -r -x.svn -u3 
svn_trunk/opengles-book-samples-read-only/LinuxX11/Common/esShapes.c 
workCopy/Common/esShapes.c
--- 
svn_trunk/opengles-book-samples-read-only/LinuxX11/Common/esShapes.c    2012-05-27 
13:25:58.348169402 +0300
+++ workCopy/Common/esShapes.c  2012-05-26 23:43:42.619519502 +0300
@@ -52,7 +52,7 @@
 ///         if it is not NULL ) as a GL_TRIANGLE_STRIP
 //
 int ESUTIL_API esGenSphere ( int numSlices, float radius, GLfloat **vertices, GLfloat **normals, 
-                             GLfloat **texCoords, GLuint **indices )
+                             GLfloat **texCoords, GLushort **indices )
 {
    int i;
    int j;
@@ -72,7 +72,7 @@
       *texCoords = malloc ( sizeof(GLfloat) * 2 * numVertices );

    if ( indices != NULL )
-      *indices = malloc ( sizeof(GLuint) * numIndices );
+      *indices = malloc ( sizeof(GLushort) * numIndices );

    for ( i = 0; i < numParallels + 1; i++ )
    {
@@ -108,7 +108,7 @@
    // Generate the indices
    if ( indices != NULL )
    {
-      GLuint *indexBuf = (*indices);
+      GLushort *indexBuf = (*indices);
       for ( i = 0; i < numParallels ; i++ ) 
       {
          for ( j = 0; j < numSlices; j++ )
diff -r -x.svn -u3 
svn_trunk/opengles-book-samples-read-only/LinuxX11/Common/esUtil.h 
workCopy/Common/esUtil.h
--- 
svn_trunk/opengles-book-samples-read-only/LinuxX11/Common/esUtil.h  2012-05-27 
13:25:58.348169402 +0300
+++ workCopy/Common/esUtil.h    2012-05-26 23:44:36.819788237 +0300
@@ -21,6 +21,7 @@
 //  Includes
 //
 #include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
 #include <EGL/egl.h>

 #ifdef __cplusplus
@@ -185,7 +186,7 @@
 ///         if it is not NULL ) as a GL_TRIANGLE_STRIP
 //
 int ESUTIL_API esGenSphere ( int numSlices, float radius, GLfloat **vertices, GLfloat **normals, 
-                             GLfloat **texCoords, GLuint **indices );
+                             GLfloat **texCoords, GLushort **indices );

 //
 /// \brief Generates geometry for a cube.  Allocates memory for the vertex data and stores 

---------------------- Fix end ------------------------


Original issue reported on code.google.com by [email protected] on 27 May 2012 at 11:20

esUtil.c mistakes?

   // Get configs
   if ( !eglGetConfigs(display, NULL, 0, &numConfigs) )
   {
      return EGL_FALSE;
   }

   // Choose config
   if ( !eglChooseConfig(display, attribList, &config, 1, &numConfigs) )
   {
      return EGL_FALSE;
   }

eglGetConfigs only fail if display is invalid or not initialize or &numConfigs 
is NULL.  Since none of this will happen and numConfigs is not used for 
anything later eglConfigs can be removed.

eglChooseConfig will fail if display is invalid or it is passed invalid 
parameters, but it will NOT fail if it finds zero configurations.  So, if 
numConfigs is zero eglChooseConfig will "succeed" and config will remain 
uninitialized.

Original issue reported on code.google.com by [email protected] on 30 Jul 2013 at 9:49

FPS drift in Linux port

What steps will reproduce the problem?
1. run any example
2. wait for a minute
3. read console output

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
svn rev 58

Please provide any additional information below.

The time counter in the fps calculations will drift over time because of a 
subtraction instead of a reset on line 318 of LinuxX11/Common/esUtil.c

This means that even simple examples like the Hello triangle will report a 
framerate that keeps decreasing until the timer comparison rolls over and 
everything starts over. It is only visible when running with vsync enabled or 
at a low framerate (intel driver has vsync turned on by default). If running 
with vsync the accumulated error in totaltime grows until it is > 1 frame time, 
at which point the fps report will trigger one frame early and the whole 
process begins anew.

I've attached a patch that fixes the problem.

Original issue reported on code.google.com by [email protected] on 3 Mar 2012 at 7:04

Attachments:

StencilTest WebGL example doesn't reset stencil mask

Viewing the StencilTest example in 
WebGL/Chapter_11/Stencil_Test/Stencil_Test.html on my laptop (GL_VENDOR reports 
"Mesa DRI Intel(R) Ironlake Mobile x86/MMX/SSE2") displays the proper frame the 
first time Draw() is called, and then displays solid green for subsequent 
frames.

The issue seems to be that the WebGL context doesn't reset the stencil 
(espcially glStencilMask) between frames.  The attached patch fixes the problem.

Original issue reported on code.google.com by [email protected] on 4 Dec 2011 at 7:19

Attachments:

HelloTriangle error in VS2010/Windows8

What steps will reproduce the problem?
1. compile and run HelloTriangle .sln examples..

What is the expected output? What do you see instead?
Should be able to run HelloTriangle without errors

We get error because of this  line:  eglGetDisplay(hDC).
Modifying this line to query default_display  solves the problem...
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);

What version of the product are you using? On what operating system?
Windows 8.1, 
VS2010 for compilation

Original issue reported on code.google.com by [email protected] on 26 Jan 2014 at 7:44

Adapted code for the RaspberryPi

Not an issue, but Google Code makes it very hard to get in contact with the 
authors/contributors.

As a learning exercise, I've ported the Linux-X11 version of the examples to 
use the Raspberry Pi video core directly. (This is due to there being no Xlib 
route to get a display to render on currently.)

Let me know if you want me to change the text/license/etc with the code, or 
even take it down.

Code:
https://github.com/benosteen/opengles-book-samples

Blog Post:
http://benosteen.wordpress.com/2012/04/27/using-opengl-es-2-0-on-the-raspberry-p
i-without-x-windows/

(The repository doesn't have a license file in it, but the google project site 
implies MIT. )

Original issue reported on code.google.com by [email protected] on 9 May 2012 at 4:07

Broken Link

What steps will reproduce the problem?
1.Try and download the files via tortoise svn for example. 
2.
3.

What is the expected output? What do you see instead?
Downloaded files. "Does Not Exist"

What version of the product are you using? On what operating system?
Only listed. XP

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 28 Nov 2011 at 6:02

Repository contains no Copright notice

The project home on Google Code lists the intended license as MIT, however 
there is no copyright notice inside the source repository and no copy of the 
license.

Original issue reported on code.google.com by [email protected] on 22 Dec 2011 at 4:04

Iphone sample do not build on Xcode4

What steps will reproduce the problem?
1. Open "Common.xcodeproj" and Build it. (This is successful)
2. Open any other of the iphone chapters and Build it. This fails with the 
following errors:

Ld 
/Users/angus/Library/Developer/Xcode/DerivedData/Hello_Triangle-fypnijhabknpgfcl
msxopbzgnkfq/Build/Products/Debug-iphonesimulator/Hello_Triangle.app/Hello_Trian
gle normal i386
    cd /Users/angus/XcodeProjects/opengles-book-samples-read-only/iPhone/Chapter_2/Hello_Triangle
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/angus/Library/Developer/Xcode/DerivedData/Hello_Triangle-fypnijhabknpgfclmsxopbzgnkfq/Build/Products/Debug-iphonesimulator -L/Users/angus/XcodeProjects/opengles-book-samples-read-only/iPhone/Chapter_2/Hello_Triangle/../../Common/build/Debug-iphonesimulator -F/Users/angus/Library/Developer/Xcode/DerivedData/Hello_Triangle-fypnijhabknpgfclmsxopbzgnkfq/Build/Products/Debug-iphonesimulator -filelist /Users/angus/Library/Developer/Xcode/DerivedData/Hello_Triangle-fypnijhabknpgfclmsxopbzgnkfq/Build/Intermediates/Hello_Triangle.build/Debug-iphonesimulator/Hello_Triangle.build/Objects-normal/i386/Hello_Triangle.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -lCommon -o /Users/angus/Library/Developer/Xcode/DerivedData/Hello_Triangle-fypnijhabknpgfclmsxopbzgnkfq/Build/Products/Debug-iphonesimulator/Hello_Triangle.app/Hello_Triangle

ld: warning: directory not found for option 
'-L/Users/angus/XcodeProjects/opengles-book-samples-read-only/iPhone/Chapter_2/H
ello_Triangle/../../Common/build/Debug-iphonesimulator'
ld: library not found for -lCommon
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 
failed with exit code 1

ld: warning: directory not found for option 
'-L/Users/angus/XcodeProjects/opengles-book-samples-read-only/iPhone/Chapter_2/H
ello_Triangle/../../Common/build/Debug-iphonesimulator'

ld: library not found for -lCommon

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 
failed with exit code 1



What is the expected output? What do you see instead?

I expected to see something on the iPhone emulator. Instead I see "Build 
Failed".

What version of the product are you using? On what operating system?

I checked out revision 51. I'm using Xcode4 on OSX 10.6.6.





Original issue reported on code.google.com by [email protected] on 19 Apr 2011 at 3:34

The flaw of stack overflow in the function of esLogMessage

What steps will reproduce the problem?
1. Transfering a message longer than BUFSIZE bytes to esLogMessage make the 
stack overflow.

Solution:


///
// esLogMessage()
//
//    Log an error message to the debug output for the platform
//
void ESUTIL_API esLogMessage ( const char *formatStr, ... )
{
    va_list params;

    va_start ( params, formatStr );
    vfprintf ( stdout, formatStr, params );

    va_end ( params );
}

Original issue reported on code.google.com by [email protected] on 16 Mar 2012 at 3:31

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.