Comments (4)
Digging a bit deeper also shows that generated code is missing blank lines completely, for example a generated debug.go file
// Glow automatically generated OpenGL binding: http://github.com/go-gl/glow
package gl
import "C"
import "unsafe"
type DebugProc func(
source uint32,
gltype uint32,
id uint32,
severity uint32,
length int32,
message string,
userParam unsafe.Pointer)
var userDebugCallback DebugProc
//export glowDebugCallback_glcore20
func glowDebugCallback_glcore20(
source uint32,
gltype uint32,
id uint32,
severity uint32,
length int32,
message *uint8,
userParam unsafe.Pointer) {
if userDebugCallback != nil {
userDebugCallback(source, gltype, id, severity, length, GoStr(message), userParam)
}
}
from glow.
shows that generated code is missing blank lines completely
For better or worse this is working as intended. Indeed the template output is filtered through BlankLineStrippingWriter
largely to remove the huge amounts of hard-to-read whitespace that would otherwise be present in the generated files. There might be a clever middle ground but nothing I have yet bothered to implement.
from glow.
You're right. Looking at the code it's a much more complex issue than I originally thought. I am creating a simple solution that should give us nice package synopsis though, at least.
from glow.
@slimsag IMHO #41 is just opening a can of worms. I think a better solution is to scratch the BlankLineStrippingWriter altogether and fix the template. You can stop the template inserting eol with
bla{{/*
*/}}bla
and for the C typedefs re-implement Replace e.g. to
+func Replace(s, old, new string) string {
+ if s[:len(s)] != "\n" {
+ s+="\n"
+ }
+ return strings.Replace(s, old, new, -1)
+}
EDIT: created #44
from glow.
Related Issues (20)
- go 1.4 compile time increased? HOT 8
- Is it viable to use glow to generate an interface with multiple backends? HOT 9
- Three actions remaining to complete early 2015 overhaul plan. HOT 10
- More idiomatic bindings HOT 4
- error generating package HOT 4
- Code that uses unsafe.Pointer to convert an integer-typed value held in memory into a pointer is illegal and must be rewritten HOT 6
- Pointer checks in Go 1.6 HOT 2
- Generating EGL bindings fails HOT 7
- Vulkan API support? HOT 2
- Multiple extensions?!
- vulkan support? HOT 5
- Lack of extensions in the core profile HOT 10
- Unmaintained project? HOT 2
- Make constants typed HOT 5
- Use static keyword on GlowGetProcAddress instead of unique suffix.
- OpenGL 4.6 support. HOT 11
- Unable to generate binding. Authorization Failed HOT 2
- Undeclared constants related to glext.h and glcorearb.h HOT 1
- Add VertexAttribIPointerWithOffset function HOT 2
- Add DrawElementsInstancedWithOffset function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glow.