Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Oct 2012
Offline Last Active Today, 01:21 AM

#5262574 Works on AMD GPU in Windows, doesn't work on Intel GPU in Mac OS X

Posted by bioglaze on 18 November 2015 - 07:08 AM


Have you use OpenGL Profiler to debug your program on OSX?


You should be able to get a trace of OpenGL calls and context details.



I signed into that site and searched for OpenGL profiler, but it returned zero hits.



It's included in a download called "Graphics Tools for Xcode 7"

#5262248 Works on AMD GPU in Windows, doesn't work on Intel GPU in Mac OS X

Posted by bioglaze on 16 November 2015 - 08:11 AM

The *APPLE calls are needed on Mac OS X El Capitan. I'll look at the other replies later. Thank you all for your help.


I use them on El Capitan without *APPLE suffix.

#5262220 Works on AMD GPU in Windows, doesn't work on Intel GPU in Mac OS X

Posted by bioglaze on 16 November 2015 - 02:58 AM


The draw code is:

void display_func(void)
    glDrawElements(GL_TRIANGLES, triangle_indices.size()*3, GL_UNSIGNED_INT, 0);

There are no errors with the shader compile and link.


I specify the type as GLuint in the last line of this code:

// Transfer vertex data to GPU
glGenVertexArraysAPPLE(1, vaos);
    glGenBuffers(1, &buffers[0]);
    glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
    glBufferData(GL_ARRAY_BUFFER, vertices_with_face_normals.size()*6*sizeof(float), &vertices_with_face_normals[0], GL_STATIC_DRAW);
// Set up vertex positions
glVertexAttribPointer(0, 6/2, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLvoid*)0);
// Set up vertex normals
    glVertexAttribPointer(1, 6/2, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), (GLvoid*)(6/2 * sizeof(GLfloat)));
// Transfer index data to GPU
glGenBuffers(1, &buffers[1]);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, triangle_indices.size()*3*sizeof(GLuint), &triangle_indices[0], GL_STATIC_DRAW);


You should not need to use the methods ending with *APPLE. Try to remove *APPLE and see if it works.

#5260301 Idea about game engine for Linux

Posted by bioglaze on 03 November 2015 - 07:13 AM

So you want to make an engine and an editor? That's a lot of work for a school project so better scope it well. I'd suggest using Qt for the editor.

#5259716 Singletons and Game Dev

Posted by bioglaze on 30 October 2015 - 04:14 AM

There are different kinds of globals. Immutable globals are better than mutable.

#5256348 Tell me the 10? ways to API wisdom

Posted by bioglaze on 09 October 2015 - 06:53 AM

All lighting, matrix, fog functions etc. are gone and you have to implement them yourself or use libraries.

#5251315 System requirements

Posted by bioglaze on 09 September 2015 - 05:23 AM

With 1.3 GHz your compile times will be slow.

#5247808 opengl 4 inizialization without glut and other tools

Posted by bioglaze on 20 August 2015 - 12:40 AM

Here's how I create a GL 4.4 context without any helper libraries on Windows: https://github.com/bioglaze/aether3d/blob/master/Engine/Video/WindowWin32GL.cpp

#5242787 Pimpl and potential alternatives

Posted by bioglaze on 26 July 2015 - 11:40 AM

Pimpl can be implemented without dynamic allocation with C++11:


class Test
        struct Impl;
        Impl& m() { return reinterpret_cast<Impl&>(_storage); }
        Impl const& m() const { return reinterpret_cast<Impl const&>(_storage); }
        static const std::size_t StorageSize = 1384;
        static const std::size_t StorageAlign = 16;
        std::aligned_storage<StorageSize, StorageAlign>::type _storage;



    reinterpret_cast< Impl* >(&_storage)->~Impl();

// TODO: also implement copy constructor and assignment operator.

#5233999 Resources for refreshing C++ skills

Posted by bioglaze on 10 June 2015 - 12:20 AM


Book: Effective Modern C++ by Scott Meyers

#5217581 How 3D engines were made in the 80's and 90's without using any graph...

Posted by bioglaze on 19 March 2015 - 01:56 AM

Back in the day I learned software rasterization and engine coding from this tutorial: 3DICA

#5208832 Next-Gen OpenGL To Be Shown Off Next Month

Posted by bioglaze on 05 February 2015 - 01:52 AM

I'm waiting for this talk and luckily will be able to attend it live. Will definitely write a blog post afterwards.

#5208830 Any cool books out there on Game Programming tips

Posted by bioglaze on 05 February 2015 - 01:30 AM

GPU Pro is also a great book series.

#5208600 Asset for testing normal mapping

Posted by bioglaze on 04 February 2015 - 05:43 AM

On this topic, does anyone know of any place to get test assets for a "typical" PBR pipeline? I.e. diffuse-, spec-, gloss/roughness-, spec-power,masking- and normal/heightmaps (and other stuff I can't think of?).


I haven't personally tested this, but bookmarked some time ago, they claim to support PBR: http://gametextures.com/

#5208175 Clean up and what to keep in mind

Posted by bioglaze on 02 February 2015 - 06:38 AM

Some points are slightly off-topic, but these are some of the things I do to maintain code quality:


* Avoid mutable global state including static variables inside methods

* Make sure that classes and methods do not do too many things ("Separation of Concerns")

* Avoid boolean parameters to functions, they are not very readable and are often used to select code paths that belong to their own separate functions

* Express intent by using algorithms instead of loops, wrapping stuff into well-named methods etc.

* Use forward-declarations as much as possible

* Declare everything const and use non-const variables only when you have to

* Avoid too many method parameters

* Read Effective C++ series

* Use static-analysis tools like CppCheck and PVS-Studio and high warning level in your compiler

* Compile your code using different compilers to find missing STL #includes and non-standard code