pouët.net

Go to bottom

how do i get started with opengl and shader coding?

category: code [glöplog]
since i apparently need something called a "glorp" to post links, look at the Raw OpenGL blog you had shown me.
Looks like someone else ran into the same issue with MinGW as you did, so this patch may help: https://github.com/alaingalvan/CrossWindow/pull/31

That being said, as a sidenote, you might wanna consider just getting Visual Studio Community, if you're doing Windows development anyway, which will potentially make your life easier.
added on the 2024-08-10 21:37:17 by Gargaj Gargaj
Thanks!

Also, I chose the MSYS2 Shell collection with the GCC compiler collection to ensure compatibility between multiple platforms (or at least Windows and Linux)
nvm.

even after making sure i updated everything, it still fails to build. i did a git pull --recurse-submodules to update everything. Yet here's how it goes:

eveything is fine!

[100%] Linking CXX executable bin\OpenGLSeed.exe

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx12GetExtensionEPKc[_ZN4xgfx12GetExtensionEPKc]+0x16): undefined reference to `__imp_wglGetProcAddress'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE[_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE]+0xe9): undefined reference to `__imp_wglCreateContext'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE[_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE]+0x105): undefined reference to `__imp_wglMakeCurrent'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE[_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE]+0x12b): undefined reference to `__imp_wglMakeCurrent'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE[_ZN4xgfx13createContextEPN4xwin6WindowERKNS_10OpenGLDescE]+0x13b): undefined reference to `__imp_wglDeleteContext'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx10setContextERKNS_11OpenGLStateE[_ZN4xgfx10setContextERKNS_11OpenGLStateE]+0x22): undefined reference to `__imp_wglMakeCurrent'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\OpenGLSeed.dir/objects.a(Main.cpp.obj):Main.cpp:(.text$_ZN4xgfx14destroyContextERKNS_11OpenGLStateE[_ZN4xgfx14destroyContextERKNS_11OpenGLStateE]+0x1a): undefined reference to `__imp_wglDeleteContext'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: external/crosswindow/libCrossWindow.a(Win32Window.cpp.obj):Win32Window.cp:(.text+0x594): undefined reference to `DwmSetWindowAttribute'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: external/crosswindow/libCrossWindow.a(Win32Window.cpp.obj):Win32Window.cp:(.text+0x6c7): undefined reference to `DwmEnableBlurBehindWindow'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: external/crosswindow/libCrossWindow.a(Win32Window.cpp.obj):Win32Window.cp:(.text+0x6e1): undefined reference to `DwmExtendFrameIntoClientArea'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [CMakeFiles\OpenGLSeed.dir\build.make:136: bin/OpenGLSeed.exe] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:155: CMakeFiles/OpenGLSeed.dir/all] Error 2
mingw32-make: *** [Makefile:90: all] Error 2

it's honestly getting annoying at this point.
I know nothing about your build system, but it sounds like you are also not linking against -lopengl32?
added on the 2024-08-12 22:46:40 by Sesse Sesse
linking? i don't get.
I just tell CMake to build it and it does. I tell Mingw32-make with no extra args to build it and it fails.
Well, it looks like you are missing a library that it should be linking against. Opengl32.lib is needed at least, although i'm not sure where all those missing implemenetations are.

Fwiw, I would use Visual Studio for this. Making the basic stuff with windowing etc. work is a pain regardless if you don't have experience in it, and it's extra pain if you want to make it multiplatform (and you can do most of that with GLFW). At least with VS Windows development should mostly work out of the box.
added on the 2024-08-13 09:20:01 by Preacher Preacher
if you insist on having some opengl boilerplate to start with, try building https://github.com/Polytonic/Glitter instead of Opengl-Seed. or just follow https://learnopengl.com/Getting-started/Creating-a-window etc. and you basically write the same boilerplate code yourself as you follow the tutorials. That creating-a-window page also explains how to set up the project from scratch with the required dependencies (which seems to be your problem). take it in baby steps!
thank you! although i'm gonna have to figure out everything eventually. Iill figure it out as i go though!
You could also use GLFW, it's pretty easy to set up and works pretty well across all platforms.
added on the 2024-08-18 19:56:43 by Gargaj Gargaj
Looked back at my notes from a long time ago.. when I last worked with OpenGL in anger this got me going well.. it uses more modern OpenGL 3+ using shaders throughout

http://www.opengl-tutorial.org/beginners-tutorials/
added on the 2024-08-19 17:08:48 by Canopy Canopy
@Gargaj +1 on the shout for GLFW, but it's a shame that the particular resource linked does not mention the compilation or linking process (which I think is OP's main issue) until a hand-wavey "this is best explained by the documentation for that environment" in the last paragraph.
added on the 2024-08-20 17:18:18 by Fell Fell
Vulkan is the way, according to opengl.org (2021). SPIR-V uses GLSL primarily but HLSL samples are usable.

Vulkan is available in all major languages including Object Pascal, which at least removes the problem of C family languages giving any and all excuses before compiling, which might be your actual problem instead of which framework. (You will need up to date headers for any language and any API.)

Vulkan gives detailed control over the frame loop and is optimized. It needs 3 use cases maintained per finished release and there's your SDL. Sadly, this hasn't happened yet. :'(

All else is a descent into versionitis, where nothing is finished, everything breaks on the next update, and I don't recommend you waste your time on that. Write modular code.
added on the 2024-08-20 22:27:58 by Photon Photon
Vulkan is not for beginners. It's not for most not-beginners either.
added on the 2024-08-21 07:00:37 by Preacher Preacher
Maybe it would be a good idea to create a demo coding course on Udemy or Coursetro. Whoever makes one could even make some decent money.
added on the 2024-08-21 08:44:48 by tomcatmwi tomcatmwi
Quote:
Vulkan is available in all major languages including Object Pascal


what am I reading :O this is terrible advice.
The design decision of choosing a programming language should not be "I did not understand how the other language works". Object Pascal might have use cases, why not learn a language many people use, as beginner, because, you know, the availability of documentation (common problems are then documented on stackoverflow). And speaking of, Vulkan is just also not a good idea if you want to get into democode: It's a moloch and also you're blocking your path to size coding, as effect SPIR-V tends to be gigantic and compresses terribly.
added on the 2024-08-21 09:01:17 by NR4 NR4
Quote:
Vulkan is not for beginners. It's not for most not-beginners either.

Neither is OpenGL...
added on the 2024-08-21 10:34:04 by absence absence
google and half a brain
i wrote a big part of a nv30 driver, what on ps3 later became libgcm

just apply yourself, dont be a fucking pussy
put the time in there are no easy ways out
added on the 2024-08-21 14:37:54 by superplek superplek
plek, I like this Elitegroup-style mindset. All lazy scene coders should invest in their spare time at least the same amount of hours it took you to single-handedly implement libgcm as part of your paid job.

Other than that: What preacher said.
added on the 2024-08-22 13:31:12 by arm1n arm1n
I ruined my education and social part of of my youth by locking myself up with cola, compiler and a linker. Who the hell are you to claim that my professional career is the only thing that drove me? I actually stopped coding recently, because I rather sell RC cars for 30% of the money or less than sell my soul any longer. Go fuck yourself and your preconceived notions.
added on the 2024-08-22 15:56:17 by superplek superplek
Oh, so you already spent all that cash from the Nixxes/Sony shares on booze? ;)
added on the 2024-08-22 18:06:11 by arm1n arm1n
Quote:
just apply yourself, dont be a fucking pussy

Quote:
I ruined my education and social part of of my youth by locking myself up with cola, compiler and a linker.

There's some degree of irony in that suggestion.
added on the 2024-08-22 19:40:29 by absence absence
Bunch of armchair warriors ;)
added on the 2024-08-22 20:00:39 by superplek superplek
Statistically, I would assume relatively few demos are made by bypassing the driver and creating one's own. Like, if you're looking for a recipe for success.
added on the 2024-08-22 20:32:56 by Sesse Sesse

login

Go to top