Catalyzes the phosphorylation of glucose using polyphosphate or ATP as the phosphoryl donor. [phosphate](n) + D-glucose = [phosphate](n-1) + D-glucose 6-phosphate + H(+) ATP + D-glucose = ADP + D-glucose 6-phosphate + H(+) Homodimer. The poly(P)- and ATP-dependent glucokinase reactions both follow an ordered Bi-Bi mechanism, with glucose being the second substrate to bind and glucose 6-phosphate being released last. The mechanism of poly(P) utilization is not strictly processive and is most likely nonprocessive, where there is dissociation of poly(P) prior to complete utilization. Belongs to the ROK (NagC/XylR) family.