Michaelangel007 / freetype-gl

Automatically exported from code.google.com/p/freetype-gl
Other
0 stars 0 forks source link

Windows build still has problems #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
working base: r119

1, VS do not support C99, so the compiler option "/TP" must be used to indicate 
that the source should be treated as C++
2. lib GLEW should be included and placed in "freetype-gl/windows"
3. glut.h should be placed in "freetype-gl/windows/glut/GL"
4. CMakeLists.txt has bugs about path setting under WIN32
5. source code has compatible problems under VS:
        a. void* ptr; ptr+=1;  // it's not allowed 
        b. stdlib.h must be included before glut.h
        c. some demos need to init glew

Patch is attached below.

Original issue reported on code.google.com by wangyong...@gmail.com on 7 Mar 2012 at 6:32

Attachments:

GoogleCodeExporter commented 9 years ago
This helps vastly. Most projects compile (13) without the need for additional 
libraries. The console demo still seems to have a lot of problems on Windows 
though. Besides the texture demo, they all seem to crash though. The call to 
vertex_buffer_render in the benchmark demo seems to be the reason why for that 
one, and vertex_buffer_upload inside of that, but I'm unable to find the exact 
cause because my debugger isn't working correctly. Do these fixes allow you to 
compile and run everything smoothly in Windows?

Original comment by XGIHa...@gmail.com on 14 Mar 2012 at 2:36

GoogleCodeExporter commented 9 years ago
Maybe. At least I have compiled and run all demo successfully  on my Windows 
machine. 
The crash problem you mentioned maybe caused by the absent of OpenGL extension. 
Try initialize GLEW before glut main loop.

Original comment by wangyong...@gmail.com on 14 Mar 2012 at 4:22

GoogleCodeExporter commented 9 years ago
Yup, right after glut creates the window. Forgot about that, thanks a lot. 
"markup_t normal"'s initialization in benchmark is incorrect, at least from 
what I know. For the other errors in that demo, libstdc++ missing from my build 
seems to be the cause. Could probably use wcscpy_s in Windows to avoid having 
to install it.

Original comment by XGIHa...@gmail.com on 15 Mar 2012 at 4:22

GoogleCodeExporter commented 9 years ago
After testing all of them, the display list demo still crashes even after 
initializing GLEW. The subpixel demo doesn't seem to render correctly on my 
machine, at least in comparison with the screenshot provided by the project 
home page. Screenshot is attached.

Original comment by XGIHa...@gmail.com on 15 Mar 2012 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
I fixed the display list demo.

For the subpixel demo, the ouput is definitely weird. Do you know by any change 
what are is the default pixel order on your graphic card ? (RGB, BGR, something 
else ?)

Nicolas

Original comment by Nicolas.Rougier@gmail.com on 21 Mar 2012 at 3:18

GoogleCodeExporter commented 9 years ago
I don't, but maybe you do. The card is a nVIDIA GTX460. The effect is similar 
with the gamma demo, so I think it is something to do with the gamma 
correction. Regardless of the gamma correction setting for my video card, the 
bug occurs.

Original comment by XGIHa...@gmail.com on 21 Mar 2012 at 5:18

GoogleCodeExporter commented 9 years ago
Question, I noticed subpixel-gamma.frag included with the build. It's not being 
used by the application, is that intentional?

Original comment by XGIHa...@gmail.com on 21 Mar 2012 at 5:57

GoogleCodeExporter commented 9 years ago
Display list is abandoned by OpenGL, instead use vertex buffer

Original comment by wangyong...@gmail.com on 22 Mar 2012 at 1:55

GoogleCodeExporter commented 9 years ago
For the subpixel demo, do you know if your freetype implementation has been 
compiled with subpixel rendering ?

(check for #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in 
freetype2/freetype/config/ftoption.h)

Nicolas

Original comment by Nicolas.Rougier@gmail.com on 22 Mar 2012 at 6:52

GoogleCodeExporter commented 9 years ago
I have all but the texture demos crashing and only 12 actually compiling after 
applying the patches.  Someone referred to the requirement to initialise GLEW; 
can they please post the code for that and indicate where it needs to go?

Original comment by Felix.Be...@gmail.com on 22 Mar 2012 at 8:59

GoogleCodeExporter commented 9 years ago
That was the problem for the subpixel problem, thanks. Why is it disabled in 
the library provided in this build? Gamma still does not work correctly. To 
Felix, glewInit(); after the glutCreateWindow calls. As wang said, display list 
isn't a good demonstration. Lower sizes don't render very well for me, and all 
the way through the font size list, the 'x' in "fox" is way lower than the rest 
of the word and string.

Original comment by XGIHa...@gmail.com on 22 Mar 2012 at 12:13

GoogleCodeExporter commented 9 years ago
Sorry for the long delay.

Subpixel is disabled because it was patented until quite recently.

glewInit() should go in each of the demo just after glut window creation

glutInit(&argc, argv);
glutCreateWindow("GLEW Test");
GLenum err = glewInit();
if (GLEW_OK != err)
{
  /* Problem: glewInit failed, something is seriously wrong. */
  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
  ...
}

Have a look at: http://glew.sourceforge.net/basic.html

Original comment by Nicolas.Rougier@gmail.com on 23 May 2012 at 5:50

GoogleCodeExporter commented 9 years ago
No update for the past two months -> I close the issue.
Feel free to re-open it if needed.

Original comment by Nicolas.Rougier@gmail.com on 19 Jul 2012 at 8:54