Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library is untested and has no examples #21

Open
pwaller opened this issue Jul 28, 2016 · 13 comments
Open

Library is untested and has no examples #21

pwaller opened this issue Jul 28, 2016 · 13 comments

Comments

@pwaller
Copy link
Member

pwaller commented Jul 28, 2016

This repository is made by enthusiasts. Unfortunately it's not ready-to-ship code, and may require some expertise to use.

We should add some good examples. Unfortunately, neither me nor @jteeuwen (AFAIK) have time to work on this at the moment, so help is welcomed!

Feel free to ping this thread on a frequency less than once/month to show your interest.

Supercedes #18 #19 #20 go-gl/gl#58

@ghost
Copy link

ghost commented Jul 28, 2016

Sorry for all the posts on the same matter, I was attempting to get in contact with someone and it seems it has worked. Last night I attempted to use this library and had little luck. I only used loadttffont and printf which is fairly simple but threw errors at runtime. I will continue to play around with the code and post any results

@fanmanpro
Copy link

Anyone got an working example of this yet?

@pwaller
Copy link
Member Author

pwaller commented Nov 26, 2016

Not that I am aware, sorry. The situation is still the same as in the original post.

@cmaglie
Copy link

cmaglie commented Feb 26, 2017

I'm not an OpenGL expert, I'm just playing a bit and wanted to share my discoveries, here what I've found after some trial-and-error:

To load a font

	fontFile, err := os.Open("Roboto-Light.ttf")
	if err != nil {
		log.Panicf("Open font file: %s", err)
	}
	defer fontFile.Close()
	font, err := gltext.LoadTruetype(fontFile, 25, 32, 127, gltext.LeftToRight)
	if err != nil {
		log.Panicf("LoadTruetype: %s", err)
	}

25 is the font size
32 and 127 are the first and last gliph that should be loaded into the texture used for later rendering (in this case the most common ASCII characters).

In the drawing loop I used the following lines:

	gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)

	gl.MatrixMode(gl.MODELVIEW)
	gl.LoadIdentity()

	gl.Color4f(0, 0, 0, 1)
	font.Printf(0, 0, "Hello")

and indeed this is enough to print "Hello" in the top left corner of the screen.

@ghost
Copy link

ghost commented Mar 16, 2017

There's also https://github.com/loov/zombies-on-ice containing a great reference on drawing images and font.

dmitshur added a commit that referenced this issue Mar 28, 2017
The gltext examples were removed in go-gl/example#39
because they were unmaintained. Still, it's better to link to last
available version than to have a 404 link.

Updates #21.
@4ydx
Copy link

4ydx commented May 17, 2017

If looking for another example of rendering golang text: https://github.com/4ydx/gltext/tree/master/example

@dmitshur
Copy link
Member

dmitshur commented May 24, 2017

It's been a while and no one stepped up to fix and maintain this library. It's in a poor shape, and without someone actively working on it, it won't get better.

To help maintain a high bar for packages in go-gl namespace, I propose we move this to go-gl-legacy. This will help future people who run into it, and accidentally expect it to be in good shape (e.g., see go-gl/example#63).

If someone wants to actively work on it, they can do so and we can consider moving it back when it's in a good shape.

@pwaller
Copy link
Member Author

pwaller commented May 24, 2017

Agreed.

@4ydx
Copy link

4ydx commented May 30, 2017

I have my own version of gltext at https://github.com/4ydx/gltext. I don't know if it meets expectations in terms of code, but I would be happy take responsibility using that as a starting point. It adds onto what go-gl/gltext does in ways that might not be standard given that I am a novice when it comes to opengl development.

@dmitshur
Copy link
Member

dmitshur commented May 30, 2017

I think for a package to (continue to) reside in go-gl namespace, it should, at minimum, have one active user, and one active maintainer. And when I say active, I mean that an issue or a PR that is posted should get a response within a month by someone willing to deal with it (even if to say "this feature request is out of scope" or "this is a valid bug that needs to be investigated/fixed").

When multiple months go by without any response/activity, that's no longer a package that should continue to be here IMO.

@4ydx, if you're actively using and maintaining your gltext version, we can definitely consider putting it here in place of this gltext. Because this gltext isn't actively maintained and we'll need to move it to go-gl-archive soon (at the current rate).

@4ydx
Copy link

4ydx commented May 31, 2017

Sure if you decide to move the current package into archive and find that mine is palatable then I will maintain it.

@4ydx
Copy link

4ydx commented Jun 27, 2017

I am eager to have my code be more broadly used as well as to be apart of group collaboration so if my code looks acceptable I would like to have it become the gltext package.

@jakecoffman
Copy link

@shurcooL: I second using @4ydx's version, he is responsive to issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants