Coder Social home page Coder Social logo

sb6code's People

Contributors

grahamsellers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sb6code's Issues

sb6render

Having the following error if i want to compile the "sb6mrender":

////////////////////////////////////////////////////////////////////////////
[ 71%] Building CXX object CMakeFiles/sb6mrender.dir/src/sb6mrender/sb6mrender.cpp.o
In file included from /home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/src/sb6mrender/sb6mrender.cpp:25:0:
/home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/include/vmath.h: In instantiation of ‘vmath::Tquaternion::’:
/home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/include/vmath.h:677:5: instantiated from ‘vmath::Tquaternion’
/home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/include/arcball.h:112:25: instantiated from here
/home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/include/vmath.h:682:25: error: member ‘vmath::Tvec3 vmath::Tquaternion::::::v’ with constructor not allowed in union
/home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/include/vmath.h:682:25: error: member ‘vmath::Tvec3 vmath::Tquaternion::::::v’ with copy assignment operator not allowed in union
/home/sajjad/Downloads/OpenGL/SuperBible/code/sb6code/include/vmath.h:682:25: note: unrestricted unions only available with -std=c++0x or -std=gnu++0x
make[2]: *** [CMakeFiles/sb6mrender.dir/src/sb6mrender/sb6mrender.cpp.o] Error 1
make[1]: *** [CMakeFiles/sb6mrender.dir/all] Error 2
make: *** [all] Error 2

///////////////////////////////////////////////////////////////////////////

Any way to get rid of it ? Do i have to edit the Makefile ?

Thanks

Linux Nvidia glXGetProcAddress Fail to compile

Hi ,
Under ubuntu 13.04 with nvidia 331.xx i get this compilation error.

/usr/bin/ld: /usr/local/lib/libglfw.so: undefined reference to symbol 'glXGetProcAddress'
/usr/bin/ld: note: 'glXGetProcAddress' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so so try adding it to the linker command line.
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so: could not read symbols: Invalid operation

Which i guess isn't supported in the nvidia stuff?
what workaround i could have?

bumpmapping example uses GLSL #version 410 but uses 4.2 binding syntax.

https://github.com/openglsuperbible/sb6code/blob/master/bin/media/shaders/bumpmapping/bumpmapping.fs.glsl

and

https://github.com/openglsuperbible/sb6code/blob/master/bin/media/shaders/bumpmapping/bumpmapping.vs.glsl

Both have #version 410 core at the top but use binding syntax that according to https://www.opengl.org/wiki/Sampler_(GLSL)#Version_4.20_binding is only for OpenGL 4.2 or later causing it to fail to compile on nvidia and not render.

Simple fix, bump the version to 420 core.

book errata?

Does anyone know where a list of corrections is for this book?

How can I see the result window?

I'm very new to OpenGL. I want to learn it from the Blue Book (OpenGL superbible 6th edition).

When I compile the first program with Visual Studio 2013, everything goe well, except that a white window appears and then the program quit with code 0.

The program is:
// Include the "sb6.h" header file
#include "sb6.h"
// Derive my_application from sb6::application
class my_application : public sb6::application
{
public:
// Our rendering function
void render(double currentTime)
{
// Simply clear the window with red
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);

I think both the compiling and building process are working fine because the result code 0. But I cannot figure out why I don't see a red output window. Please help me.

Can't build on OS X 10.9

Even though it says 10.9 is supported, after installing CMake and generating the Makefiles, I get:

[ 6%] Built target sb6 make[2]: *** No rule to make target /usr/local/lib/libglfw.a', needed by bin/alienrain'. Stop. make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2 make: *** [all] Error 2

cannot build a clean sep project using sb6 in vs 2013

I want to work the first example in the book .

I have the folowing code

include

include"sb6.h"

class my_app:public sb6::application
{
public:
my_app(){}
void render(double currTime)
{
static const GLfloat red[] = { 1.0, 0.0f, 0.0f, 1.0f };
glClear(GL_CLEAR_BUFFER);

}

};
DECLARE_MAIN(my_app);

It give me error
c:\program files (x86)\microsoft visual studio 12.0\vc\include\string.h(112) : see declaration of 'strcpy'
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

I know its looking for main file so when I add the void main(){}
it builds but it flashes a console screen fast and that is it. I tried with different versions of vs and I get the same thing. I did attach include files sb6.h, and glfw.h and all the lib files. I also noticed the framework doesn't include 64 bit libraries . I am running windows 8 64 bit. Maybe that may be the issue. Please help thank you

sb6code/include/GL/glxext.h:683:67: error: unknown type name ‘GLXContextID’

Compile error on Ubuntu 13.10 Linux amd64:

rick@rick-W650SR:~/Documenten/sb6code$ make
[ 1%] Building C object CMakeFiles/sb6.dir/src/sb6/gl3w.c.o
In file included from /usr/include/GL/glx.h:332:0,
from /home/rick/Documenten/sb6code/src/sb6/gl3w.c:62:
/home/rick/Documenten/sb6code/include/GL/glxext.h:682:24: error: expected declaration specifiers or ‘...’ before ‘’ token
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
^
/home/rick/Documenten/sb6code/include/GL/glxext.h:683:67: error: unknown type name ‘GLXContextID’
typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
^
make[2]: *
* [CMakeFiles/sb6.dir/src/sb6/gl3w.c.o] Fout 1
make[1]: *** [CMakeFiles/sb6.dir/all] Fout 2
make: *** [all] Fout 2

I searched on the internet for this and i found out that i needed to add this line before line 683 in file sb6code/include/GL/glxext.h:

typedef XID GLXContextID;

After that it compiles fine.

This error happened after some update on Ubuntu. It compiled fine last week. I just wanted to notify you on this.

where is ktx file?

The book says that there is a ktx file in the path "media/textures/.ktx" where is it?

sb6code / src / spinnycube / spinnycube.cpp why do unnecessary VertArray allocation?

In sb6code / src / spinnycube / spinnycube.cpp, around line #98:
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
then the code fills vertex_positions -> unrelated
glGenBuffers(1, &buffer);
glBindBuffer(GL_ARRAY_BUFFER, buffer);

It seems to me that the VA generated for vao is never used. (Or did i miss anything? - if i comment it out, the code works fine)

Second issue: (at around line #186)
vmath::mat4 mv_matrix = vmath::translate(0.0f, 0.0f, -6.0f) *
vmath::rotate((float)currentTime * 45.0f, 0.0f, 1.0f, 0.0f) *
vmath::rotate((float)currentTime * 21.0f, 1.0f, 0.0f, 0.0f) *
vmath::translate(sinf(2.1f * f) * 2.0f,
cosf(1.7f * f) * 2.0f,
sinf(1.3f * f) * cosf(1.5f * f) * 2.0f);
If i use the transformations in this order, the cube leaves the screen. If i flip the translations with rotations, the cube starts rotating around its local axes -> looks better

Models are missing

Many of the example look in media/objects for models. That folder does not exist though.

Can you add/upload it?

Are there plans to move to glfw3?

glfw3 changes quite a few of the api calls, but seems like they are moving away from the 2.x versions. Is there any development towards this? I don't mind forking and starting it, but just didn't want to overlap any current development.

Thanks!
Danny G

Add example of persistently mapped buffer

GL_MAP_PERSISTENT_BIT is not used in any of the examples and hence AZDO is never demonstrated in its entirety. I am very surprised the 6th edition does not include an example of this.

Unless I am missing something?

Black screen caused by missing texture media files.

Several of the examples, such as alienrain and tunnel, try to load texture files from the bin/media/textures directory. For example, alienrain line number 151

tex_alien_array = sb6::ktx::file::load("media/textures/aliens.ktx");

The textures directory and the files in it are missing in github and also missing from the zip file on the superbible website. Without the texture files these examples just display a black screen. Does anybody have access to these texture files?

Linker error (Ubuntu 16.04) - undefined reference to `glfwInit'

I am unable to get even the basics running in Ubuntu 16.04. I've also tried to edited the CMakeLists.txt according to #24 but the linker still complains

[  4%] Built target sb6
[  5%] Linking CXX executable bin/wrapmodes
CMakeFiles/wrapmodes.dir/src/wrapmodes/wrapmodes.cpp.o: In function `sb6::application::run(sb6::application*)':
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x30): undefined reference to `glfwInit'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x89): undefined reference to `glfwOpenWindowHint'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x9f): undefined reference to `glfwOpenWindowHint'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xae): undefined reference to `glfwOpenWindowHint'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xbd): undefined reference to `glfwOpenWindowHint'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xd3): undefined reference to `glfwOpenWindowHint'
CMakeFiles/wrapmodes.dir/src/wrapmodes/wrapmodes.cpp.o:wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xfd): more undefined references to `glfwOpenWindowHint' follow
CMakeFiles/wrapmodes.dir/src/wrapmodes/wrapmodes.cpp.o: In function `sb6::application::run(sb6::application*)':
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x13b): undefined reference to `glfwGetDesktopMode'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x193): undefined reference to `glfwOpenWindow'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1b1): undefined reference to `glfwSwapInterval'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1f1): undefined reference to `glfwOpenWindow'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x231): undefined reference to `glfwSetWindowTitle'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x23b): undefined reference to `glfwSetWindowSizeCallback'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x245): undefined reference to `glfwSetKeyCallback'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x24f): undefined reference to `glfwSetMouseButtonCallback'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x259): undefined reference to `glfwSetMousePosCallback'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x263): undefined reference to `glfwSetMouseWheelCallback'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x27a): undefined reference to `glfwEnable'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x281): undefined reference to `glfwDisable'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x292): undefined reference to `glfwGetWindowParam'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x376): undefined reference to `glfwGetTime'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x384): undefined reference to `glfwSwapBuffers'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x38e): undefined reference to `glfwGetKey'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3ae): undefined reference to `glfwGetWindowParam'
wrapmodes.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3e8): undefined reference to `glfwTerminate'
lib/libsb6.a(gl3w.c.o): In function `open_libgl':
gl3w.c:(.text+0xf): undefined reference to `dlopen'
lib/libsb6.a(gl3w.c.o): In function `close_libgl':
gl3w.c:(.text+0x2c): undefined reference to `dlclose'
lib/libsb6.a(gl3w.c.o): In function `get_proc':
gl3w.c:(.text+0x47): undefined reference to `glXGetProcAddress'
gl3w.c:(.text+0x68): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
CMakeFiles/wrapmodes.dir/build.make:95: recipe for target 'bin/wrapmodes' failed
make[2]: *** [bin/wrapmodes] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/wrapmodes.dir/all' failed
make[1]: *** [CMakeFiles/wrapmodes.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Anyone any ideas how to fix this? Thanks!

Fails to Compile Linux Mint (Issues linking glfw)

I have issues getting the code to compile and need some help. Nothing I've tried has worked so far. I am using linux mint 16 and have been programming for a while with opengl and have not ran into any problems, yet can not get these examples to compile. I have install glfw via 'apt-get libgflw-dev' and it has worked fine for me when running other code. My error looks like the program is not linking glfw properly, does anyone have suggestions to help me compile these examples on linux? When I compile with make I get the following error:

[ 6%] Built target sb6 Linking CXX executable bin/alienrain CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function sb6::application::run(sb6::application*)': alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x21): undefined reference to 'glfwInit'

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.