Re: [fpc-pascal] Save image into BMP or JPEG using Free Pascal (Save screenshot of OpenGL scene)
> Jakub Marian wrote: > > The image format in the memory is clearly specified, as the main use of > this unit is to cooperate with OpenGL (for loading images, textures, > saving screenshots etc.). See TImage class comments, basically RawPixels > is simply a pointer to an array of Width * Height pixel values, and each > descendant of TImage specifies the exact layout of "pixel" --- e.g. for > TRGBImage a pixel is just 3 bytes, for red/green/blue. Is the latter a hard requirement of OpenGL? In the fpimage rework, I had hoped to skip 24-bit color and use 32-bit for that. Also, does OpenGL support bottom up (lines other way around in memory) layouts, or only top down? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Dependency on other tools ? (Spaces in path issue ?)
Hello, I have come to the point where I want to add files to the search/unit path. I have spaces in my folders and the compiler fails to find the files. This raises some questions: 1. How independant is free pascal compiler ? What other tools does it depend on ? 2. What exactly happens when I "press the compile button", where is the linker ? Website says: integrated linker for windows. This raises the second most important question: 3. Why is there still a spaces-in-path issue ? And finally the most important question: 4. Is there a work around ? Bye, Skybuck. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Empty record inside another record ?
In every language I know, words can have multiple meanings. The context in which the words are used determines their meaning. One possible reason could be because there is so much to describe that coming up with unique words might be impossible or inpractical. Bye, Skybuck. Skybuck Flying schrieb: For records, I would use an extension field like: IP.Payload and UDP.Payload I would hardly call that obfuscation :) Having the same name for different things is always obfuscation. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Empty record inside another record ?
> In every language I know, words can have multiple meanings. Natural languages yes. But they need a billion neurons that is trained for 20 years to interpret, not a simple automaton. IOW, lots of computer languages don't. > One possible reason could be because there is so much to describe that > coming up with unique words might be impossible or inpractical. I think the main reason is that brains naturally don't process information _without_ context. It's not just words, but also intonation, facial expression of the speaker, posture etc. Abstracting is a learned skill. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Empty record inside another record ?
> The context in which the words are used determines their meaning. And that's exactly the problem: good code is understandable with as little as possible context. Any context depending behaviour/meaning makes code less readable and less maintainable. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Save image into BMP or JPEG using Free Pascal (Save screenshot of OpenGL scene)
Marco van de Voort wrote: Jakub Marian wrote: The image format in the memory is clearly specified, as the main use of this unit is to cooperate with OpenGL (for loading images, textures, saving screenshots etc.). See TImage class comments, basically RawPixels is simply a pointer to an array of Width * Height pixel values, and each descendant of TImage specifies the exact layout of "pixel" --- e.g. for TRGBImage a pixel is just 3 bytes, for red/green/blue. Is the latter a hard requirement of OpenGL? In the fpimage rework, I had hoped to skip 24-bit color and use 32-bit for that. There is GL_RGBA format, combined with GL_UNSIGNED_BYTE this makes 32 bit pixel (with the last byte for storing alpha --- depending on what you actually do with your image data, you may be able to simply ignore it). Also, does OpenGL support bottom up (lines other way around in memory) layouts, or only top down? AFAIK, no. That is, OpenGL images always have the lowest row first in the memory. Everyone simply swaps the rows in memory for OpenGL, since all image formats have this the other way around. Michalis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] GLext in Free Pascal does not work?
Hello, I've been trying to solve the problem with the unit GLext for some time and I am getting mad. I need to use vertex shaders written in GLSL, but I am a novice in that field so I may be doing domething wrong. I have glext in my "uses". I tried just to call glCreateProgramObjectARB but I've got access violation in my program. So I looked into source of glext and there are some functions which look like I could use them. So I tried glext_LoadExtension('GL_version_1_4'). Same problem - access violation. So I tried glext_ExtensionSupported with some parameters. Access violation. I am really getting mad, I have no idea what to do. I am really opened to any suggestions :-) Thank you Jakub Marian -- View this message in context: http://www.nabble.com/GLext-in-Free-Pascal-does-not-work--tp15599350p15599350.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] GLext in Free Pascal does not work?
Jakub Marian wrote: Hello, I've been trying to solve the problem with the unit GLext for some time and I am getting mad. I need to use vertex shaders written in GLSL, but I am a novice in that field so I may be doing domething wrong. I have glext in my "uses". I tried just to call glCreateProgramObjectARB but I've got access violation in my program. So I looked into source of glext and there are some functions which look like I could use them. So I tried glext_LoadExtension('GL_version_1_4'). Same problem - access violation. So I tried glext_ExtensionSupported with some parameters. Access violation. I am really getting mad, I have no idea what to do. I am really opened to any suggestions :-) glCreateProgramObjectARB is part of GL_ARB_shader_objects extension (see OpenGL extension registry on opengl.org). So what you want to call is Load_GL_ARB_shader_objects or (equivalent) glext_LoadExtension('GL_ARB_shader_objects') They both return boolean value, if true --- then your OpenGL supports this extension, and glCreateProgramObjectARB entry point is initialized to non-nil and you can call it without any access violations. glext_LoadExtension('GL_version_1_4') loads OpenGL features that are standard in OpenGL 1.4, this has nothing to do with glCreateProgramObjectARB ("ARB" suffix says this is an extension). OpenGL 2.0 introduced shaders as standard, so you may want to call Load_GL_version_2_0 and then use glCreateProgram instead of glCreateProgramObjectARB. But for now, using extension is a little safer (more chance that given OpenGL implementation will support it). Oh, and if you have downloaded my engine mentioned in previous mail --- see kambi_vrml_game_engine/opengl/glshaders.pas, this is my unit for handling OpenGL shaders, see TGLSLProgram class. Michalis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] GLext in Free Pascal does not work?
Well, glext_LoadExtension('GL_version_1_4') was just an example, of course that I tried Load_GL_version_2_0 and some other functions. But I get "access violation" when I try to call ANY function from glext. I would understand it if I got just false as a return value of a function... But the program goes down with Access violation message written into command line window. For example if I call Load_GL_version_2_0, I get: An unhandled exception occurred at $100279D9 : EAccessViolation : Access violation $100279D9 $0040769D P.S. I will take a look at glshaders.pas and decide if I can find the source of problem. Tank you very much for your reply. Jakub Marian -- View this message in context: http://www.nabble.com/GLext-in-Free-Pascal-does-not-work--tp15599350p15601377.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] GLext in Free Pascal does not work?
Jakub Marian wrote: Well, glext_LoadExtension('GL_version_1_4') was just an example, of course that I tried Load_GL_version_2_0 and some other functions. But I get "access violation" when I try to call ANY function from glext. I would understand it if I got just false as a return value of a function... But the program goes down with Access violation message written into command line window. For example if I call Load_GL_version_2_0, I get: An unhandled exception occurred at $100279D9 : EAccessViolation : Access violation $100279D9 $0040769D Ah, are you on x86_64 ? Then you're affected by [http://bugs.freepascal.org/view.php?id=10508], it's fixed in SVN. Michalis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal