FFGL Text Rendering

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
CatSack
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Mar 12, 2021 21:46

FFGL Text Rendering

Post by CatSack »

Hi,
I am completely brand new to all of this (Resolume, FFGL, so on) but I've gotten the general gist of it. I can make a simple plugin with FFGL, and I'm pretty good with WebGL, but I have very little C++/C experience. I've been asked to code a plugin involving text rendering, which I found out you should do with FreeType. I got it imported correctly, and have been trying to follow along with some tutorials I found, but to be honest I have no idea where to put any of the code. Any help getting started would be greatly appreciated!

Zoltán
Team Resolume
Posts: 7075
Joined: Thu Jan 09, 2014 13:08
Location: Székesfehérvár, Hungary

Re: FFGL Text Rendering

Post by Zoltán »

Software developer, Sound Engineer,
Control Your show with ”Enter” - multiple Resolume servers at once - SMPTE/MTC column launch
try for free: http://programs.palffyzoltan.hu

CatSack
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Mar 12, 2021 21:46

Re: FFGL Text Rendering

Post by CatSack »

Zoltán wrote: Mon Mar 15, 2021 13:53 This might help: viewtopic.php?f=14&t=17231
I checked that out already, that's actually where I got the idea to use FreeType. I've read enough tutorials about it to get how it works, I'm just unsure where I should put everything in my existing code. Thank you though!

Menno
Team Resolume
Posts: 137
Joined: Tue Mar 12, 2013 13:56

Re: FFGL Text Rendering

Post by Menno »

Perhaps the examples in the ffgl repo can be of use to you. For example https://github.com/resolume/ffgl/blob/m ... dients.cpp

stuff you need to do once during loading go into InitGL, Rendering goes into ProcessOpenGL. If you need help with how to use c++ you're probably best off to find a tutorial or book somewhere.

CatSack
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Mar 12, 2021 21:46

Re: FFGL Text Rendering

Post by CatSack »

Menno wrote: Thu Mar 18, 2021 14:49 Perhaps the examples in the ffgl repo can be of use to you. For example https://github.com/resolume/ffgl/blob/m ... dients.cpp

stuff you need to do once during loading go into InitGL, Rendering goes into ProcessOpenGL. If you need help with how to use c++ you're probably best off to find a tutorial or book somewhere.
I looked around at those a little already, and I think the issue is that I'm just not very familiar with FFGL's code structure. I know what all of the FreeType tutorials are doing, I just don't know where I should put that. I've tried rearranging their code in many ways and putting it inside of different functions but it always gives a similar error about an "unresolved external symbol". I know that I've imported FreeType correctly, and the error only pops up whenever I try to use previously created FreeType variables. An example of the first chunk of code that would be used for FreeType looks like this:

Code: Select all

	FT_Library ft;
	FT_Face face;

	if( FT_Init_FreeType(&ft))
	{
		(throw error)
	}

	if(FT_New_Face(ft, "FreeSans.ttf", 0, &face))
	{
		(throw error)
	}

	FT_Set_Pixel_Sizes( face, 0, 48 );

	if( FT_Load_Char( face, 'X', FT_LOAD_RENDER ) )
	{
		(throw error)
	}

	FT_GlyphSlot g = face->glyph;
Wherever the variables ft or face get used, the error gets thrown (like the if statements or FT_Set_Pixel_Sizes). I've tried putting that code in all sorts of places but it always does the same thing.
This is about as far as I've managed to get with this, any help would be greatly appreciated!

Menno
Team Resolume
Posts: 137
Joined: Tue Mar 12, 2013 13:56

Re: FFGL Text Rendering

Post by Menno »

Looks like you aren't linking freetype correctly.
Perhaps something like this could help? https://www.learncpp.com/cpp-tutorial/a ... 5-express/

freetype should have a description on how to build it from source or where to get a binary library, i think it includes project files to build the library already.

Post Reply