I am porting some OpenGL Nvidia C samples to jogl and I have the following (init
is one of the abstract methods required by GLEventListener
:
public abstract class NvAppBase implements GLEventListener {
@Override
public void init(GLAutoDrawable drawable) {
initRendering(gl4);
}
public void initRendering(GL4 gl4) {
}
}
public abstract class NvSampleApp extends NvAppBase {
@Override
public void init(GLAutoDrawable drawable) {
baseInitRendering(gl4);
}
protected void baseInitRendering(GL4 gl4) {
initRendering(gl4);
}
@Override
public void initRendering(GL4 gl4) {
}
}
public class BindlessApp extends NvSampleApp{
@Override
public void initRendering(GL4 gl4) {
}
}
Given that:
NvAppBase
is not used at all, all the samples (such asBindlessApp
) always extendNvSampleApp
- I'd like the class extending
NvSampleApp
to being able to see (and overwrite) only theinitRendering
and not also theinit
Is there a better way than just having NvSampleApp
simply as a variable inside BindlessApp
, like this for example?
public class BindlessApp {
private NvSampleApp sampleApp;
}