September 16, 2016
On Thursday, 15 September 2016 at 19:03:22 UTC, Darren wrote:

>
> This is the code I'm using: https://dfcode.wordpress.com/2016/09/15/texcodewip/
> (The code for the shaders is at the bottom)
>
> For comparison, this is the code I'm trying to make work:
> http://www.learnopengl.com/code_viewer.php?code=getting-started/textures

I don't have time to try and test this myself, but this looks like a potential problem here:

```
auto textureFormat = surface.format.format;
glTexImage2D(GL_TEXTURE_2D, 0, surface.format.BytesPerPixel, surface.w, surface.h, 0, textureFormat, GL_UNSIGNED_BYTE, surface.pixels);
```

You're passing an SDL enum value to OpenGL, which knows absolutely nothing about SDL enum values. Rather than passing surface.format.format directly to OGL, you need to first match it to the appropriate OGL format enum and pass *that*, which is what I tried to explain in my previous post. This is easily done by making a function which contains a switch statement iterating all of the SDL_PIXELFORMAT_* values and returning the equivalent GL_* value.

At any rate, if you're using the same image as the example, you don't need to do that in this specific case. You can safely ignore surface.format.format and simply pass GL_RGB, which is what the example uses. You only need to do the SDL->GL conversion for a texture loader that is intended to load multiple pixel formats.
September 16, 2016
On Friday, 16 September 2016 at 01:54:50 UTC, Mike Parker wrote:
>snip

Okay,I actually had GL_RGB for those two fields and it didn't work, but I guess I didn't try them again after I fixed the crash issue because now it works fine.
Thanks again for the guidance!
October 04, 2016
Back again with another little problem that isn't specifically OpenGL related, but is a result of getting such code to work.

Code I'm working on: https://dfcode.wordpress.com/2016/10/04/linker-problem/
What I'm learning from: http://www.learnopengl.com/#!Getting-started/Camera, http://www.learnopengl.com/code_viewer.php?type=header&code=camera

The problem is I'm trying to move camera code into a module and import it, but when I try to build I'm getting the following error messages:

source\app.d(256,30): Error: function 'fpscamera.fpsCamera.processMouseMovement' is not nothrow
source\app.d(243,7): Error: function 'app.mouse_callback' is nothrow yet may throw

If I add nothrow to processMouseMovement, like I did for some other functions, I get the following:

.dub\build\application-debug-windows-x86-dmd_2071-3EF635850CA47CC4E927BFC9336E0233\ogl.obj(ogl)
 Error 42: Symbol Undefined _D9fpscamera9fpsCamera13getViewMatrixMxFNdZS4gl3n6linalg21__T6MatrixTfVii4Vii4Z6Matrix
.dub\build\application-debug-windows-x86-dmd_2071-3EF635850CA47CC4E927BFC9336E0233\ogl.obj(ogl)
 Error 42: Symbol Undefined _D9fpscamera9fpsCamera20processMouseMovementMFNbffhZv
.dub\build\application-debug-windows-x86-dmd_2071-3EF635850CA47CC4E927BFC9336E0233\ogl.obj(ogl)
 Error 42: Symbol Undefined _D9fpscamera9fpsCamera18processMouseScrollMFNbfZv
.dub\build\application-debug-windows-x86-dmd_2071-3EF635850CA47CC4E927BFC9336E0233\ogl.obj(ogl)
 Error 42: Symbol Undefined _D9fpscamera9fpsCamera15processKeyboardMFE9fpscamera14CameraMovementfZv
.dub\build\application-debug-windows-x86-dmd_2071-3EF635850CA47CC4E927BFC9336E0233\ogl.obj(ogl)
 Error 42: Symbol Undefined _D9fpscamera12__ModuleInfoZ
--- errorlevel 5

It seems to happen if I make both processMouseMovement and processMouseScroll nothrow to get rid of the error messages.  If one or the other is nothrow, I get the nothrow message for that function.
October 05, 2016
On Tuesday, 4 October 2016 at 16:09:34 UTC, Darren wrote:
> Back again with another little problem that isn't specifically OpenGL related, but is a result of getting such code to work.

I actually figured it out; my own mistakes.
1 2 3
Next ›   Last »