all
a
/
b
/
c
/
f
/
h
/
j
/
jp
/
l
/
o
/
q
/
s
/
sw
/
lounge
cgi
up
wiki
Heyuri!
Bulletin Boards
2D Cute
2D Ero
2D Lolikon
3D Girls
Anime/Manga
Flash
Girl Talk
日本語/Japan
Lounge
Oekaki
Off-Topic
Site Discussion
Strange World
Overboard
Heyuri★CGI
Heyuri★CGI
@PartyII
Battle Royale R
Chat
Chinsouki★
Dating
DevChat
Drama Club
Hakoniwa Islands PvE
Hakoniwa Islands PvP
Polls
Slime Breeder
Web Banana
Web Shiritori
Yumemiru Gambler
Kakiko Checker
Other
Anime Nominations
Banners
Heyuri Wiki
Museum
Uploader
Heyuri Pasta
Jukebox
Sumika Controller
Heyuri Calendar
Cytube
Townhall
MAL Club
Steam Group
[
Settings
]
[
Home
] [
Contact
] [
Catalog
] [
Search
] [
Thread list
] [
Stats
] [
Reports
] [
Watcher
] [
PMs
] [
Banners
] [
Admin
]
Main
Up to Heyuri.net
Hide nav
Toggle board directories
Bulletin boards
/c/ -
2D Cute
/h/ -
2D Ero
/l/ -
2D Lolikon
/s/ -
3D Girls
/a/ -
Anime/Manga
/lounge/ -
Lounge
/f/ -
Flash
/j/ -
Girl Talk
/jp/ -
日本語/Japan
/o/ -
Oekaki
/b/ -
Off-Topic
/q/ -
Site Discussion
/sw/ -
Strange World
/all/ -
Overboard
Misc.
Anime Nominations
Banners
Heyuri Wiki
Museum
Uploader
Heyuri Pasta
Jukebox
Sumika Controller
Heyuri Calendar
Game Nominations
AHoge Editor
Mattari AA
Simple AA Tester
Heyuri★CGI
Heyuri★CGI
@PartyII
Battle Royale R
Chat
Chinsouki★
Dating
DevChat
Drama Club
Hakoniwa Islands PvE
Hakoniwa Islands PvP
Polls
Slime Breeder
Web Banana
Web Shiritori
Yumemiru Gambler
Kakiko Checker
External
Cytube
Townhall
MAL Club
Steam Group
Yui uploader
YuiBox
#heyuri@Rizon
Heyuri status
Style:
Random
Sakomoto
Heyuri Classic
Futaba
Burichan
Fuuka
Gurochan
Photon
Tomorrow
Ayashii
Mercury
Import custom
Submit board banners here.
Off-Topic@Heyuri
it's the place to be!
[
Return
]
Report a post
Preview
File:
1743217265104497.jpg
(196 KB, 1000x970)
[
ImgOps
]
ImgOps
Hide image
▶
Opengl question pls help
Anonymous
2025/05/17(Sat)18:07:14
No.
143927
+
[OP tools off]
AS
[
Thread tools
]
[
Edit
] [
Report
]
▶
i keep getting errors when compiling a shader, i have no idea why ( ´,_ゝ`)
this is all from a tutorial in
https://learnopengl.com/Getting-started/Hello-Triangle
i just tried to clean it up a little by creating a function to compile shaders instead of putting them all in main()
bool getCompileResult(unsigned int *shader, const char *src) {
glShaderSource(*shader, 1, &src, nullptr);
//the error is in glShaderSource! (error is GL_INVALID_VALUE)
//etc....
}
const char *vertexShaderSource = "#version 330 core\n"
"layout (location = 0) in vec3 aPos;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
"}\0";
int main() {
//some stuff
unsigned int vertexShader = glCreateShader(GL_VERTEX_SHADER);
if(!getCompileResult(&vertexShader, vertexShaderSource))
return -1;
}
i feel like i'm maybe making mistakes with pointers but i checked what *src in getCompileResult points to and it's exactly the source i declared
the opengl documentation says:
>GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.
>GL_INVALID_VALUE is generated if maxLength is less than 0.
it cant be the second because i passed nullptr to glShaderSource which means it knows the string is null terminated, but idk what "shader is not a value generated by OpenGL" means
any help?
Post number
No.
143927
Board
Off-Topic@Heyuri
Reason
Optional. Describe what's wrong with it.
Style: