Dgame revived

John Colvin via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Feb 27 01:04:00 PST 2015


On Thursday, 26 February 2015 at 02:22:18 UTC, stewarth wrote:
> On Wednesday, 25 February 2015 at 15:36:21 UTC, Gan wrote:
>> On Tuesday, 24 February 2015 at 22:03:29 UTC, stewarth wrote:
>>> On Tuesday, 24 February 2015 at 21:10:53 UTC, Gan wrote:
>>>> On Tuesday, 24 February 2015 at 21:07:04 UTC, stewarth wrote:
>>>>> On Tuesday, 24 February 2015 at 19:32:08 UTC, Gan wrote:
>>>>>> On Tuesday, 24 February 2015 at 16:28:59 UTC, Namespace 
>>>>>> wrote:
>>>>>>>> I had to force dub to upgrade in order for it to pull 
>>>>>>>> the latest code from the master branch.
>>>>>>>>
>>>>>>>> But on the plus side it runs.
>>>>>>>>
>>>>>>>> On the downside it still only displays a blank white 
>>>>>>>> screen for Mac users.
>>>>>>>
>>>>>>> As growlercab pointed out 
>>>>>>> (https://github.com/Dgame/Dgame/pull/29), I think also 
>>>>>>> that you should set the Version to 3.2 rather than 3.0. 
>>>>>>> Could you give it a try and say if that works for you?
>>>>>>
>>>>>> No dice. Running the shapes tutorial again, just a blank 
>>>>>> screen. Console output looks good though:
>>>>>> init openAL
>>>>>> Derelict loaded GL version: GL33 (GL33), available GL 
>>>>>> version: 3.3 INTEL-10.0.22
>>>>>> Quit Event
>>>>>> Finalize Sound (0)
>>>>>> >> Sound Finalized
>>>>>> Text: Finalize Font
>>>>>> Font finalized
>>>>>> Close open Windows.
>>>>>> Open Windows closed.
>>>>>> Finalize Texture (0)
>>>>>> >> Texture Finalized
>>>>>> quit sdl
>>>>>
>>>>> Did you try commenting out the line that sets the forward 
>>>>> compatibility flag as well?
>>>>> (sorry it isn't clear from the posts)
>>>>>
>>>>> if (style & Style.OpenGL) {
>>>>> SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
>>>>> SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
>>>>> SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, 
>>>>> SDL_GL_CONTEXT_PROFILE_CORE);
>>>>> /*
>>>>> * SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS,
>>>>> *           SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG);
>>>>> */
>>>>> }
>>>>>
>>>>> This fixed a similar issue for me on Linux.
>>>>>
>>>>> Cheers,
>>>>> stew
>>>>
>>>> Yeah I did that, doesn't show anything but a blank white 
>>>> screen.
>>>
>>> OK, thanks for letting me know.
>>
>> Is there anything more I can test to try to get it working on 
>> Mac?
>>
>> Also anyone else have a Mac to test on? I wanna make sure it's 
>> not just me getting the blank white screen.
>
> Without a MAC I am just guessing, but my next steps would be 
> along the lines of:
>
> 1. The venerable printf binary search bug hunt approach :)
>
> Check glGetError, which you can turn the error into a string 
> with GLU as follows:
>
> ---
> void reportGLErrors() {
>     GLenum errCode;
>     const GLubyte *errString;
>     if ((errCode = glGetError()) != GL_NO_ERROR)
>     {
>         errString = gluErrorString(errCode);
>         writeln(errString.fromStringz)
>     }
> // UNTESTED!!
> }
> ---

This module should work as a standalone with a few tiny import 
changes: 
https://github.com/Dav1dde/glamour/blob/master/glamour/util.d

The interesting bit is checkgl, used for example like this:

checkgl!glDrawArrays(GL_POINTS, 0, 10);

then you get a nice debug message if glDrawArrays reports an 
error. It will also report if a previous error has occurred and 
wasn't cleared, but of course in that case it won't be able to 
tell you where.

I wrap every OpenGL call with checkgl, it helps immensely.


More information about the Digitalmars-d-announce mailing list