memononen / fontstash

Light-weight online font texture atlas builder
zlib License
688 stars 88 forks source link

opengl3 example? #34

Open starseeker opened 7 years ago

starseeker commented 7 years ago

Is there any chance someone could either add an OpenGL 3 version of the example application or tweak the existing one to work with the new header? A naive substitution doesn't appear to produce a working test, unless I'm missing something...

behrisch commented 5 years ago

I experienced the same. After replacing the glfontstash.h with gl3corefontstash.h no text appears. I am using glew 2.1.0 to access the GL extensions, if that matters. @starseeker Did you find a solution?

bruenor41 commented 5 years ago

Hi, did you succeed with gl3 version please?

behrisch commented 5 years ago

@bruenor41 No, I did not.

Nairou commented 5 years ago

I haven't looked at the examples in a long time, but I use NanoVG (same author, uses fontstash) in a GL3 project just fine. If I remember correctly, the NanoVG examples are GL3, so you could look at those as well.

On Tue, Oct 15, 2019, 10:08 AM Michael Behrisch notifications@github.com wrote:

@bruenor41 https://github.com/bruenor41 No, I did not.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/memononen/fontstash/issues/34?email_source=notifications&email_token=AAHGA3SIVGI3IXKFWCW3BV3QOXFFFA5CNFSM4DWARNJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBI4SHY#issuecomment-542230815, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHGA3SIG4FVRSS6UQIGZL3QOXFFFANCNFSM4DWARNJQ .

bruenor41 commented 5 years ago

I use nanovg in my application too, but i face problem with matrix. Nanovg uses own matrix and has no way accept my transformed matrix. I draw text wih nanovg, but i must handle it's transformations in special way. That's why I need cut it from nanovg, i tried it, but it is hard for me

mindoff6502 commented 4 years ago

Hi,everyone,luckily I found a GL3 example with SDL 2.0.7,maybe more people could use it. https://github.com/suikki/sdf_text_sample

bruenor41 commented 4 years ago

Many thanks for info, will try run it on my phone

On Sun, Mar 1, 2020 at 6:14 AM mindoff6502 notifications@github.com wrote:

Hi,everyone,luckly I found a GL3 example with SDL 2.0.7,maybe more people could use it. https://github.com/suikki/sdf_text_sample

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/memononen/fontstash/issues/34?email_source=notifications&email_token=AGIJKLPC4KWYUC5OIP6ZQ5DRFHVMJA5CNFSM4DWARNJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENMU7VY#issuecomment-593055703, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIJKLIBYGQG576OGSBUTLLRFHVMJANCNFSM4DWARNJQ .

mindoff6502 commented 4 years ago

Hey,I just want to say I success to use that GL3 example with glfw and glew on my GL3.3 project under Windows Platform,quite good.

Anyone who knows opengl 3 could adapt to any GL3 project,SDL or glfw or any other opengl framework lib. It totally works.

And with this example I think it won't be hard to port to DX or any other API.

zblcm commented 1 year ago

Looks like the master branch is missing GLSL shader now. You need to write your own.

The author made another PR which contains shader but it is not merged: https://github.com/memononen/fontstash/pull/23/files I did't compile it, but it has a good shader to reference.