Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Will this book I bought help me at all?  (Read 2219 times)

0 Members and 1 Guest are viewing this topic.

jakobb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Will this book I bought help me at all?
« on: February 08, 2014, 02:27:35 am »
Hello everyone,

I recently purchased this book: http://www.amazon.com/gp/product/0321712617

The author uses their own wrapper called sb6, I'm assuming to make things easier. It's extremely confusing, although it incorporates GLFW from what I can tell. I knew this was the case before I purchased the book, however, I assumed that the actual OpenGL API function calls would be the same no matter what framework for handling windows you use. Apparently I was completely wrong. Even the first OpenGL function mentioned in the book, "glClearBufferfv()", doesn't work in SFML. What's weird is that some things do work, like the data type "GLfloat".

What I really want to do is write OpenGL applications inside SFML so I can have access to all of its useful features. What I really need to know is if this book is essentially a $50 paperweight for my purposes, and also if there is documentation somewhere on the API you can use within SFML, where is it?


Thank you for the help,

~Jakob

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Will this book I bought help me at all?
« Reply #1 on: February 08, 2014, 03:11:22 am »
If you combine this tutorial with GLEW you should be able to access all the opengl functionality that your card supports.

jakobb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Will this book I bought help me at all?
« Reply #2 on: February 08, 2014, 04:44:25 am »
Do I need to integrate GLEW into SFML just to access the OpenGL API at all? Or does integrating GLEW into SFML let me use the functionality used in the book? Or both?

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Will this book I bought help me at all?
« Reply #3 on: February 08, 2014, 05:12:49 am »
When you #include <SFML/OpenGL.hpp> you are getting your operating system's implementation of OpenGL, which for windows is quite old. It will give you some basic things, but most modern opengl things won't work. That's where GLEW comes into it, it basically lets you access modern opengl. What actually works depends on your graphics card and drivers, but GLEW gives you an easy way to check your gfx card capabilities.

So if you want to do modern opengl stuff then you'll need to install and link GLEW to your SFML application.

jakobb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Will this book I bought help me at all?
« Reply #4 on: February 08, 2014, 05:20:55 am »
Ahh, I was under the impression that SFML had OpenGL working out of the box! Thank you for clearing that up for me, I appreciate it.

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Will this book I bought help me at all?
« Reply #5 on: February 08, 2014, 06:00:50 am »
Developing OpenGL on windows is harder than it should be (thx to directx), and you'll find that most libraries (SDL, GLFW, etc.) will need either GLEW, GLEE, or something similar to get easy access to modern OpenGL functionality. There's been some discussion on this forum about whether SFML should expose GLEW or not (which it uses internally), but its now hidden completely, which is why you need to link it in yourself if you want to use it.

 

anything