SIGSEGV when calling glGenBuffers lazarus / 70-OpenGL ---------------------------------------------------------------------- LemonParty · 2024-12-18 18:29 Hello. I trying to use glGenBuffers function from unit GLext this way: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  VBO: GLuint;{...}glGenBuffers(1, @VBO);And I getting SIGSEGV on glGenBuffers(1, @VBO); line. What I missing? ---------------------------------------------------------------------- zamtmn · 2024-12-18 18:47 If you use GLext.pp? you need run Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Load_GL_version_1_5or later GL version init function, and it need return true ---------------------------------------------------------------------- Thaddy · 2024-12-18 19:15 Quote from: LemonParty on December 18, 2024, 07:29:11 pmHello. I trying to use glGenBuffers function from unit GLext this way: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  VBO: GLuint;{...}glGenBuffers(1, @VBO);And I getting SIGSEGV on glGenBuffers(1, @VBO); line. What I missing? Memory allocation... Basic mistake. VBO needs memory... Allocmem, Getmem, New... ---------------------------------------------------------------------- zamtmn · 2024-12-18 19:28 Thaddy The first principle is to read the documentation. And you often don't do that in a hurry to answer the question ---------------------------------------------------------------------- H₂SO₄ · 2024-12-19 06:26 Quote from: Thaddy on December 18, 2024, 08:15:45 pmMemory allocation... Basic mistake. VBO needs memory... Allocmem, Getmem, New... Have you ever used OpenGL? Like @zamtmn said, you'll have to call one of the  Load_GL_***  functions to initialize OpenGL before using it. Because graphics drivers are very hardware-specific, they're loaded as dynamic libraries and can vary from host to host. FPC's OpenGL units declare all API functions as function pointers (initialized to  Nil) and resolves their actual values only when calling one of the aforementioned  Load_GL_***  functions, with each variant only resolving the functions that are required by that version of the OpenGL specification. Looking at the OpenGL documentation for  glGenBuffers and scrolling to the bottom of the page, we can see that it is only supported from version 2.0 and onwards, so you'll have to call at least  Load_GL_Version_2_0. So in essence, the segfault you're getting has nothing to do with  @VBO, but with the fact that you're calling a function pointer whose value is  Nil  (if you hover over  glGenBuffers  in Lazarus you'll see that it is declared as a  var). ---------------------------------------------------------------------- LemonParty · 2024-12-19 11:39 I see. Where can I download a proper DLL? ---------------------------------------------------------------------- zamtmn · 2024-12-19 12:12 >>I see. Where can I download a proper DLL? No need download dll. You need install drivers from your video card manuacturer site, not use default ms video driver. and run Load_GL_version_1_5 (or later if you yse features from later version) once, before call glGenBuffers ---------------------------------------------------------------------- LemonParty · 2024-12-19 12:44 I have installed drivers and Load_GL_version_2_0 return false. I see from source code of GLext that opengl32.dll is used when Load_GL_version_* called. ---------------------------------------------------------------------- zamtmn · 2024-12-19 13:22 You must call Load_GL_versionХХХ after create OpenGL context. What GL control you use? TOpenglControl? ---------------------------------------------------------------------- LemonParty · 2024-12-19 13:55 I using glfw. I moved Load_GL_version_2_0 after glfwMakeContextCurrent(window); and now it works. Thank you. ---------------------------------------------------------------------- Mathias · 2025-01-09 17:04 Quote from: LemonParty on December 19, 2024, 02:55:27 pmI using glfw. I moved Load_GL_version_2_0 after glfwMakeContextCurrent(window); and now it works. Thank you. The order is very important.