1

This code

(GL33/glUniform2fv ^int (location shader "offsets") ^float [] offsets)

produces this error:

No matching method glUniform2fv found taking 3 args for class org.lwjgl.opengl.GL33

I've tried removing the space:

(GL33/glUniform2fv ^int (location shader "offsets") ^float[] offsets)

to no avail.

Clojure seems to be mistaking the ^float [] type hint for a parameter - but not the ^int type hint.

What can I do about that?

2

1 Answer 1

1

Pre Clojure 1.12

As noted in the comments, floats is the way to type hint that symbol.

ref: Type Aliases

Post Clojure 1.12

If using Clojure 1.12 or later, you can specify an array class of N dimensions by using Classname/N. For your purposes here, you can write float/1.

ref: Java interop: Class access, Clojure 1.12 release notes

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.