The MASM Forum

Projects => Game Development => Topic started by: LiaoMi on December 07, 2020, 06:09:26 AM

Title: OpenGL SuperBible - Source Code
Post by: LiaoMi on December 07, 2020, 06:09:26 AM
Hi,

I noticed a very interesting book called https://www.amazon.de/OpenGL-Superbible-Comprehensive-Tutorial-Reference/dp/0672337479, the book contains a large archive of source codes in c++, but the code can be easily translated:
https://github.com/openglsuperbible/sb7code/archive/master.zip
http://openglsuperbible.com/files/superbible7-media.zip
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 07, 2020, 07:30:51 PM
 :thumbsup:
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 07, 2020, 08:05:59 PM

first try to compile:
unistd.h is missing : sb7.h(36): fatal error C1083
Search in the pack ,not found
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 08, 2020, 03:44:25 AM

Need the GLFW  https://www.glfw.org/download.html (https://www.glfw.org/download.html)
Need to build a library in  \Glu_bible\src\sb7
.........
Quote
alienrain.obj : error LNK2019: symbole externe non r,solu "int __cdecl sb6IsExtensionSupported(char const *)" (?sb6IsExtensionSupported@@YAHPEBD@Z) r,f,renc, dans la fonction "public: virtual void __cdecl sb7::application::run(class sb7::application *)" (?run@application@sb7@@UEAAXPEAV12@@Z)
alienrain.obj : error LNK2019: symbole externe non r,solu "private: static void __cdecl sb7::application::debug_callback(unsigned int,unsigned int,unsigned int,unsigned int,int,char const *,void *)" (?debug_callback@application@sb7@@CAXIIIIHPEBDPEAX@Z) r,f,renc, dans la fonction "public: virtual void __cdecl sb7::application::run(class sb7::application *)" (?run@application@sb7@@UEAAXPEAV12@@Z)
alienrain.obj : error LNK2019: symbole externe non r,solu "unsigned int __cdecl sb7::ktx::file::load(char const *,unsigned int)" (?load@file@ktx@sb7@@YAIPEBDI@Z) r,f,renc, dans la fonction "private: virtual void __cdecl alienrain_app::startup(void)" (?startup@alienrain_app@@EEAAXXZ)
alienrain.obj : error LNK2001: symbole externe non r,solu "protected: static class sb7::application * sb7::application::app" (?app@application@sb7@@1PEAV12@EA)
s

Made a global scope on *.c *.cpp,names not found ?


Title: Re: OpenGL SuperBible - Source Code
Post by: LiaoMi on December 08, 2020, 07:39:17 AM
Quote from: TouEnMasm on December 07, 2020, 08:05:59 PM

first try to compile:
unistd.h is missing : sb7.h(36): fatal error C1083
Search in the pack ,not found

Hi TouEnMasm,

https://github.com/openglsuperbible/sb7code/blob/master/HOWTOBUILD.txt
glfw Library Release x32
glfw Library Release x64
https://www.upload.ee/files/12614195/Release.7z.html
Title: Re: OpenGL SuperBible - Source Code
Post by: LiaoMi on December 08, 2020, 09:06:19 AM
glfw-Library masm example  :tongue:
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 08, 2020, 06:32:43 PM
Have you tested the asm  ?
it is done with the provided include,don't seem very serious
Quote
Assembling: triangle.asm

***********
ASCII build
***********

triangle.asm(182) : error A2137:too few arguments to INVOKE
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 4
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 3
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 2
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 1
triangle.asm(188) : error A2137:too few arguments to INVOKE
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 9
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 8
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 7
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 6
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 5
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 4
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 3
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 2
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 1
LINK : fatal error LNK1181: cannot open input file "triangle.obj"
Appuyez sur une touche pour continuer...

For the   C ,it use cmake the one thing who never work because there is too many formal instructions in text.
The version had evoluate and .....
Try to made a build (alienrain is the one i have tried to compile) and say me if you get a result with the C code provided.
Title: Re: OpenGL SuperBible - Source Code
Post by: LiaoMi on December 09, 2020, 01:38:33 AM
Quote from: TouEnMasm on December 08, 2020, 06:32:43 PM
Have you tested the asm  ?
it is done with the provided include,don't seem very serious
Quote
Assembling: triangle.asm

***********
ASCII build
***********

triangle.asm(182) : error A2137:too few arguments to INVOKE
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 4
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 3
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 2
triangle.asm(182) : error A2114:INVOKE argument type mismatch : argument : 1
triangle.asm(188) : error A2137:too few arguments to INVOKE
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 9
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 8
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 7
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 6
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 5
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 4
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 3
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 2
triangle.asm(188) : error A2114:INVOKE argument type mismatch : argument : 1
LINK : fatal error LNK1181: cannot open input file "triangle.obj"
Appuyez sur une touche pour continuer...

For the   C ,it use cmake the one thing who never work because there is too many formal instructions in text.
The version had evoluate and .....
Try to made a build (alienrain is the one i have tried to compile) and say me if you get a result with the C code provided.

Hi TouEnMasm,

alienrain VS2019 Solution
https://www.upload.ee/files/12615892/alienrain.7z.html

In the example, the version of the library is too old (Moving from GLFW 2 to 3 - https://www.glfw.org/docs/3.0/moving.html), so the headers need to be converted again, I corrected the function prototypes, but did not check the function parameters, so the program does not start. In addition, you need to use CDECL = C
https://www.upload.ee/files/12616492/triangle_glfw_examples.7z.html

New libraries(32-64) in which I removed Enable Security Check (/GS)
https://www.upload.ee/files/12616616/glfw_Release_12.2020.7z.html
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 09, 2020, 03:03:36 AM
Ah more fun,
version glfw , i have 3.04
I have forgotten,unistd.h can be replace by io.h
perhaps later ...

Later,a sample with the alienrain exe will be greatly usefull.
There is problem beetween the C cpp in the lib + lib + %*#

Title: Re: OpenGL SuperBible - Source Code
Post by: LiaoMi on December 09, 2020, 03:17:26 AM

:biggrin: I took the last archive with the source code here https://github.com/glfw/glfw
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 09, 2020, 04:02:29 AM

There is an impressive list of bug fix..
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 09, 2020, 06:01:53 PM

Visual studio (c,c++) offer a simple way to build all that.
Oen it,in " files >> OPEN >> cmake"   and choose a cmake*.TXT .Thats all
Title: Re: OpenGL SuperBible - Source Code
Post by: TouEnMasm on December 11, 2020, 03:00:09 AM
Good news,
After a soap made with sb7code-master and glfw-master (the glfw must be inside the sb7) and yhe help of VS 2019
I have build the sb7.lib and the glfw3.lib + samples  inside the glfw-master
For the samples in the sb7code-master,They need doxygen,dowloaded.
They also need
Quote
Most of the samples require some media files. The media files package is a
separate download available from http://www.openglsuperbible.com and is
rougly 100MB of textures, object files and shader code. Unpack the archive
to the bin/media directory before trying to run these samples.
Quote
There is nothing to the link http://www.openglsuperbible
Any idea ?
Later :
http://openglsuperbible.com/files/superbible7-media.zip. (http://openglsuperbible.com/files/superbible7-media.zip.)
https://github.com/ziacko/sb7code (https://github.com/ziacko/sb7code)